Skip to content

Commit

Permalink
fix: don't crash on files not respecting name format
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ex4 committed Oct 26, 2023
1 parent 83c2978 commit cde7679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def scan_library():
file_info = identify_file(filepath, valid_keys=app_settings['valid_keys'])

if file_info is None:
print(f'Failed to identify file: {file}')
# TODO add warning
print(f'Failed to identify: {file} - file will be skipped.')
continue
add_to_titles_db(library, file_info)

Expand Down
3 changes: 3 additions & 0 deletions app/titles.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def identify_file(filepath, valid_keys=False):

else:
app_id = get_app_id_from_filename(filename)
if app_id is None:
print(f'Unable to extract title from filename: {filename}')
return None
version = get_version_from_filename(filename)
title_id, app_type = identify_appId(app_id)

Expand Down

0 comments on commit cde7679

Please sign in to comment.