From cc8ba5f574c00a0b6cecddc5377c3bbcfb77d8e5 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 6 Dec 2020 11:21:12 +0100 Subject: Ignore stickied entries when loading reddit images --- reddit_background/reddit_background.go | 5 +++++ 1 file changed, 5 insertions(+) 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 } -- cgit v1.2.3-70-g09d2