From a3ff57bc21fd298dc20e98b600e0d0cb53b591ec Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sat, 9 Sep 2023 13:56:04 -0700 Subject: [PATCH] Fix infinite addition of order:random --- sources/konachan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/konachan.py b/sources/konachan.py index 96a2c7a..da8574f 100644 --- a/sources/konachan.py +++ b/sources/konachan.py @@ -15,7 +15,8 @@ Turn a list of tags and a count into a list of URLs to download from def request_posts(count: int, tags: list) -> list: logging.debug(f"request_posts() called with count={count}, tags=[{', '.join(tags)}]") # Make sure we get a different result every time by using "order:random" as a tag - tags.append("order:random") + if "order:random" not in tags: + tags.append("order:random") # Tags are separated by a plus sign for this API tag_string: str = "+".join(tags) # Request URL for getting posts from the API