Skip to content

Commit

Permalink
remove missing titles from list on start (#327)
Browse files Browse the repository at this point in the history
- removed useless Config.isScanning
  • Loading branch information
introkun authored Sep 20, 2021
1 parent fc22561 commit 31fdc6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
11 changes: 4 additions & 7 deletions nut.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -553,9 +553,6 @@ def download(id):
Print.info(' `"_( _/="`')
Print.info(' `"\'')

if args.scan:
Config.isScanning = True

if args.dry:
Config.dryRun = True

Expand Down Expand Up @@ -687,7 +684,7 @@ def download(id):
nut.initTitles()
nut.initFiles()
nut.scan()

if args.pull:
nut.pull()

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -826,7 +823,7 @@ def download(id):
nut.initFiles()
for d in args.download:
download(d)

if args.system_update:
cdn.downloadSystemUpdate()

Expand Down
1 change: 0 additions & 1 deletion nut/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
shardCount = None
shardIndex = None
reverse = False
isScanning = False
extractVersion = False
autoUpdateTitleDb = True
allowNoMetadata = True
Expand Down
4 changes: 2 additions & 2 deletions nut/Nsps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 31fdc6f

Please sign in to comment.