Skip to content

Commit

Permalink
Fix not counting some scan results for scan statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
trickerer01 committed Jul 19, 2024
1 parent 64b9cc3 commit 0ba9c8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def __init__(self, sequence: Iterable[VideoInfo], func: Callable[[VideoInfo], Co
self._session = session
self._orig_count = len(self._seq)
self._downloaded_count = 0
self._filtered_count_pre = filtered_count
self._filtered_count_after = 0
self._prefiltered_count = filtered_count
self._already_exist_count = 0
self._skipped_count = 0
self._404_count = 0
self._minmax_id = get_min_max_ids(self._seq)
Expand All @@ -80,10 +80,10 @@ async def _at_task_finish(self, vi: VideoInfo, result: DownloadResult) -> None:
self._downloads_active.remove(vi)
Log.trace(f'[queue] {vi.sname} removed from active')
if result == DownloadResult.FAIL_ALREADY_EXISTS:
self._filtered_count_after += 1
elif result == DownloadResult.FAIL_SKIPPED:
self._already_exist_count += 1
elif result in (DownloadResult.FAIL_SKIPPED, DownloadResult.FAIL_FILTERED_OUTER):
self._skipped_count += 1
elif result == DownloadResult.FAIL_NOT_FOUND:
elif result in (DownloadResult.FAIL_NOT_FOUND, DownloadResult.FAIL_DELETED):
self._404_count += 1
elif result == DownloadResult.FAIL_RETRIES:
self._failed_items.append(vi.id)
Expand Down Expand Up @@ -202,9 +202,9 @@ async def _continue_file_checker(self) -> None:

async def _after_download(self) -> None:
newline = '\n'
Log.info(f'\nDone. {self._downloaded_count:d} / {self._orig_count:d}+{self._filtered_count_pre:d}'
Log.info(f'\nDone. {self._downloaded_count:d} / {self._orig_count:d}+{self._prefiltered_count:d}'
f'{f"+{self._scn.get_extra_count():d}" if Config.lookahead else ""} file(s) downloaded, '
f'{self._filtered_count_after:d}+{self._filtered_count_pre:d} already existed, '
f'{self._already_exist_count:d}+{self._prefiltered_count:d} already existed, '
f'{self._skipped_count:d} skipped, {self._404_count:d} not found')
workload_size = len(self._seq) + self.get_scanner_workload_size()
if workload_size > 0:
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
APP_NAME = 'NM'
APP_VER_MAJOR = '1'
APP_VER_SUB = '8'
APP_REVISION = '425'
APP_REVISION = '426'
APP_VERSION = f'{APP_VER_MAJOR}.{APP_VER_SUB}.{APP_REVISION}'

#
Expand Down

0 comments on commit 0ba9c8e

Please sign in to comment.