Skip to content

Commit

Permalink
don't validate keys each game
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ex4 committed Oct 25, 2023
1 parent 8ac69f6 commit e2e7441
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def scan_library():
continue
file = filepath.replace(library, "")
print(f'Identifiying file ({n+1}/{len(files)}): {file}')
file_info = identify_file(filepath)
if not app_settings['valid_keys']:
print('Invalid or non existing keys.txt, title identification fallback to filename only.')

file_info = identify_file(filepath, valid_keys=app_settings['valid_keys'])

if file_info is None:
print(f'Failed to identify file: {file}')
Expand Down
4 changes: 1 addition & 3 deletions app/titles.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ def load_titledb(app_settings):
with open(os.path.join(TITLEDB_DIR, 'versions.json')) as f:
versions_db = json.load(f)

def identify_file(filepath):
def identify_file(filepath, valid_keys=False):
filedir, filename = os.path.split(filepath)
extension = filename.split('.')[-1]
valid_keys, _ = validate_keys()
if valid_keys:
import Nsp as nsp

Expand All @@ -127,7 +126,6 @@ def identify_file(filepath):
title_id = app_id

else:
print('Invalid or non existing keys.txt, title identification fallback to filename only.')
app_id = get_app_id_from_filename(filename)
version = get_version_from_filename(filename)
title_id, app_type = identify_appId(app_id)
Expand Down

0 comments on commit e2e7441

Please sign in to comment.