Merge branch 'refactor' of github.com:KevinMidboe/seasonedParser into refactor
This commit is contained in:
11
src/core.py
11
src/core.py
@@ -225,7 +225,6 @@ def scan_folder(path):
|
|||||||
for _ in os.listdir(path):
|
for _ in os.listdir(path):
|
||||||
content_count += 1
|
content_count += 1
|
||||||
|
|
||||||
with click.progressbar(length=content_count, label='Collecting videos') as bar:
|
|
||||||
# non-existing
|
# non-existing
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
try:
|
try:
|
||||||
@@ -249,12 +248,12 @@ def scan_folder(path):
|
|||||||
logging.exception('Unexpected error while collecting directory path %s', path)
|
logging.exception('Unexpected error while collecting directory path %s', path)
|
||||||
errored_paths.append(path)
|
errored_paths.append(path)
|
||||||
|
|
||||||
for video in scanned_videos:
|
with click.progressbar(scanned_videos, label='Parsing found videos', item_show_function=lambda v: os.path.split(v.name)[1] if v is not None else '') as bar:
|
||||||
video.subtitle_languages |= set(search_external_subtitles(video.name,
|
for v in bar:
|
||||||
|
v.subtitle_languages |= set(search_external_subtitles(v.name,
|
||||||
directory=path).values())
|
directory=path).values())
|
||||||
refine(video)
|
refine(v)
|
||||||
videos.append(video)
|
videos.append(v)
|
||||||
bar.update(1)
|
|
||||||
|
|
||||||
return videos
|
return videos
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user