|
@ -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] |
|
|
|
|
|
|
|
|