summaryrefslogtreecommitdiff
path: root/reddit_background
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-12-06 11:21:12 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-12-06 11:21:12 +0100
commitcc8ba5f574c00a0b6cecddc5377c3bbcfb77d8e5 (patch)
treec2f35cf764f78fb9bf7a1d621aae29018b3fb4b1 /reddit_background
parentb8f7e622bbee068ac9e6a96c2307dbc7d7b02b14 (diff)
downloadstartpage-cc8ba5f574c00a0b6cecddc5377c3bbcfb77d8e5.tar.gz
startpage-cc8ba5f574c00a0b6cecddc5377c3bbcfb77d8e5.tar.bz2
startpage-cc8ba5f574c00a0b6cecddc5377c3bbcfb77d8e5.zip
Ignore stickied entries when loading reddit images
Diffstat (limited to 'reddit_background')
-rw-r--r--reddit_background/reddit_background.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/reddit_background/reddit_background.go b/reddit_background/reddit_background.go
index 60ba4ec..4b3464e 100644
--- a/reddit_background/reddit_background.go
+++ b/reddit_background/reddit_background.go
@@ -35,6 +35,7 @@ type RedditImage struct {
URL string `json:"url,omitempty"`
Permalink string `json:"permalink"`
Domain string `json:"domain"`
+ Stickied bool `json:"stickied,omitempty"`
Saved bool `json:"-"`
Data []byte `json:"-"`
origdata []byte `json:"-"`
@@ -84,6 +85,10 @@ func GetRedditImage(maxsize int, subreddit string) (*RedditImage, error) {
continue
}
+ if ri.Stickied {
+ continue
+ }
+
if ri.fetch(maxsize) {
return ri, nil
}