Browse Source

fix artist's dict cannot be found exception

pull/17/head
80002462 6 years ago
parent
commit
8904290454
  1. 7
      app.py
  2. 1
      requirements.txt

7
app.py

@ -54,9 +54,9 @@ def validate_collision(path):
def name_format(path, meta): def name_format(path, meta):
information = { information = {
'artist': ','.join([artist[0] for artist in meta['artist']]), 'artist': ','.join([artist[0] for artist in (meta.get('artist') if meta.get('artist') is not None else [])]),
'title': meta['musicName'], 'title': meta.get('musicName'),
'album': meta['album'] 'album': meta.get('album')
} }
def substitute(matched): def substitute(matched):
@ -91,6 +91,7 @@ for path in args.input:
continue continue
if os.path.isdir(path): if os.path.isdir(path):
files += [os.path.join(path, name) for name in os.listdir(path) if os.path.splitext(name)[-1] == '.ncm'] files += [os.path.join(path, name) for name in os.listdir(path) if os.path.splitext(name)[-1] == '.ncm']
print(files)
else: else:
files += [path] files += [path]

1
requirements.txt

@ -1,2 +1,3 @@
Crypto
mutagen mutagen
pycryptodome pycryptodome

Loading…
Cancel
Save