From c3d9e30470fc231bdd8743fa2d511bdd0839d49f Mon Sep 17 00:00:00 2001 From: samerbam Date: Mon, 12 Jun 2023 15:11:13 -0400 Subject: [PATCH] removed debug lines, added new exception to account for this specific issue. --- root/app/fanficdownload.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/root/app/fanficdownload.py b/root/app/fanficdownload.py index bd7bd17..ef1da1e 100644 --- a/root/app/fanficdownload.py +++ b/root/app/fanficdownload.py @@ -163,7 +163,7 @@ def downloader(args): moving, cur), 'BLUE', live) res = check_output('{}python3.9 -m fanficfare.cli -u "{}" --update-cover --non-interactive --config={}/personal.ini'.format( moving, cur, loc), shell=True, stderr=STDOUT, stdin=PIPE).decode('utf-8') - output += log(f'res: {res}', 'BLUE', live) + # output += log(f'res: {res}', 'BLUE', live) check_regexes(res) if chapter_difference.search(res) or more_chapters.search(res): output += log("\tForcing download update due to:", @@ -175,8 +175,13 @@ def downloader(args): '{}python3.9 -m fanficfare.cli -u "{}" --force --update-cover --non-interactive --config={}/personal.ini'.format( moving, cur, loc), shell=True, stderr=STDOUT, stdin=PIPE).decode('utf-8') check_regexes(res) - output += log(f'Cur: {get_files(loc, ".epub", True)}, len(cur): {len(get_files(loc, ".epub", True))}', 'BLUE', live) + # output += log(f'Cur: {get_files(loc, ".epub", True)}, len(cur): {len(get_files(loc, ".epub", True))}', 'BLUE', live) cur = get_files(loc, '.epub', True)[0] + if len(cur) > 0: + cur = cur[0] + else len(cur) == 0: + raise Exception('Could not find .epub, work likely did not download. Exception raised on get_files(loc, ".epub", True)[0].') + if storyId: output += log("\tRemoving {} from library".format(storyId),