From 31fdc6fc0be5b88f700e9bcfba4f447b647d4847 Mon Sep 17 00:00:00 2001 From: Sergey G Date: Mon, 20 Sep 2021 22:02:55 +0300 Subject: [PATCH] remove missing titles from list on start (#327) - removed useless Config.isScanning --- nut.py | 11 ++++------- nut/Config.py | 1 - nut/Nsps.py | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/nut.py b/nut.py index fcde68aa4..5ab49849e 100755 --- a/nut.py +++ b/nut.py @@ -488,7 +488,7 @@ def download(id): Hook.call("args.pre", parser) args = parser.parse_args() - + if hasCdn: if args.cdn_cache_only: Config.cdnCacheOnly = True @@ -553,9 +553,6 @@ def download(id): Print.info(' `"_( _/="`') Print.info(' `"\'') - if args.scan: - Config.isScanning = True - if args.dry: Config.dryRun = True @@ -687,7 +684,7 @@ def download(id): nut.initTitles() nut.initFiles() nut.scan() - + if args.pull: nut.pull() @@ -733,7 +730,7 @@ def download(id): try: f = nsp - f.open(str(path), 'r+b') + f.open(str(path), 'r+b') if not f.verifyNcaHeaders(): nsp.verified = False @@ -826,7 +823,7 @@ def download(id): nut.initFiles() for d in args.download: download(d) - + if args.system_update: cdn.downloadSystemUpdate() diff --git a/nut/Config.py b/nut/Config.py index eaff18d0f..280da2984 100644 --- a/nut/Config.py +++ b/nut/Config.py @@ -15,7 +15,6 @@ shardCount = None shardIndex = None reverse = False -isScanning = False extractVersion = False autoUpdateTitleDb = True allowNoMetadata = True diff --git a/nut/Nsps.py b/nut/Nsps.py index 50eacaab2..a979eefbd 100644 --- a/nut/Nsps.py +++ b/nut/Nsps.py @@ -227,13 +227,13 @@ def load(fileName='titledb/files.json', verify=True): for k in json.loads(f.read()): _nsp = Fs.factory(k['path'], k['path'], None) - if not _load_nsp_filesize(k, _nsp) or not _nsp.path: + if not _load_nsp_filesize(k, _nsp) or not hasattr(_nsp, 'path') or not _nsp.path: continue _fill_nsp_from_json_object(_nsp, k) path = os.path.abspath(_nsp.path) - if verify and Config.isScanning: + if verify: if cache.isfile(path) and not _is_file_hidden(path): files[path] = _nsp else: