From 9b0bc9dc4c2bf3a5b0ea2429ec2f902c171e0d76 Mon Sep 17 00:00:00 2001 From: MrTyton Date: Tue, 24 Sep 2024 16:25:39 -0400 Subject: [PATCH] Fix potential bug where a url could be added multiple times from email. --- release-versions/calibre.txt | 2 +- release-versions/fff.txt | 2 +- release-versions/latest.txt | 2 +- root/app/url_ingester.py | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/release-versions/calibre.txt b/release-versions/calibre.txt index 37b8110..f003ad1 100644 --- a/release-versions/calibre.txt +++ b/release-versions/calibre.txt @@ -1 +1 @@ -7.13.0 \ No newline at end of file +7.18.0 \ No newline at end of file diff --git a/release-versions/fff.txt b/release-versions/fff.txt index 846f86f..d815923 100644 --- a/release-versions/fff.txt +++ b/release-versions/fff.txt @@ -1 +1 @@ -4.36.2 \ No newline at end of file +4.38.0 \ No newline at end of file diff --git a/release-versions/latest.txt b/release-versions/latest.txt index e8ef0a7..562c3e9 100644 --- a/release-versions/latest.txt +++ b/release-versions/latest.txt @@ -1 +1 @@ -2024.07.27-1 \ No newline at end of file +2024.09.24 \ No newline at end of file diff --git a/root/app/url_ingester.py b/root/app/url_ingester.py index be807c3..819ed00 100644 --- a/root/app/url_ingester.py +++ b/root/app/url_ingester.py @@ -138,6 +138,7 @@ def email_watcher( while True: # Get URLs from the email account urls = email_info.get_urls() + fics_to_add = set() for url in urls: fanfic = regex_parsing.generate_FanficInfo_from_url(url) ff_logging.log( @@ -150,6 +151,8 @@ def email_watcher( "New Fanfiction Download", fanfic.url, fanfic.site ) continue - processor_queues[fanfic.site].put(fanfic) + fics_to_add.add(fanfic) + for fic in fics_to_add: + processor_queues[fic.site].put(fic) # Wait before checking the email account again time.sleep(email_info.sleep_time)