From 00aad774ae0099a7ef2ed2ed481d333cf0f6f418 Mon Sep 17 00:00:00 2001 From: karamori77 <78544883+karamori77@users.noreply.github.com> Date: Tue, 20 Apr 2021 11:04:52 +0800 Subject: [PATCH] Fixed potential re-download Moved forward save-history check 1 indent so it works with download by id too Mapped all ids to int since there are cases where its a string in the API --- nhentai/command.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nhentai/command.py b/nhentai/command.py index 8b05406..bc987fb 100644 --- a/nhentai/command.py +++ b/nhentai/command.py @@ -65,11 +65,11 @@ def main(): if options.is_download and doujinshis: doujinshi_ids = [i['id'] for i in doujinshis] - if options.is_save_download_history: - with DB() as db: - data = map(int, db.get_all()) + if options.is_save_download_history: + with DB() as db: + data = map(int, db.get_all()) - doujinshi_ids = list(set(doujinshi_ids) - set(data)) + doujinshi_ids = list(set(map(int, doujinshi_ids)) - set(data)) if doujinshi_ids: for i, id_ in enumerate(doujinshi_ids): -- 2.44.0