From 16a88bc8dc8657959fdf25950d795e40c164251e Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Thu, 26 Feb 2026 14:16:03 -0300 Subject: [PATCH] Increment download_index in finally block --- votify/cli/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/votify/cli/cli.py b/votify/cli/cli.py index 4a04c36..ed6e6c3 100644 --- a/votify/cli/cli.py +++ b/votify/cli/cli.py @@ -171,7 +171,6 @@ async def main(config: CliConfig): await downloader.download(item) await asyncio.sleep(config.wait_interval) - download_index += 1 except StopAsyncIteration: break except VotifyUrlParseException as e: @@ -200,5 +199,7 @@ async def main(config: CliConfig): download_queue_progress + f' Error downloading "{media_title}"', exc_info=not config.no_exceptions, ) + finally: + download_index += 1 logger.info(f"Finished with {error_count} error(s)")