cleanup
This commit is contained in:
parent
c61c00dfd6
commit
d4fbd7a829
2 changed files with 15 additions and 7 deletions
|
@ -86,6 +86,8 @@ class SyncFile(MutableMapping):
|
|||
self.seen = False
|
||||
|
||||
def __getitem__(self, key):
|
||||
if self.md == None:
|
||||
print(self.path)
|
||||
d = self.md[key]
|
||||
try:
|
||||
return d[0]
|
||||
|
|
20
unsync.py
20
unsync.py
|
@ -15,7 +15,8 @@ import convert
|
|||
from mutaext import SyncFile
|
||||
|
||||
# BUG: doesn't work with my .m4a files?
|
||||
goodexts = ('.mp3', '.m4a', '.flac', '.ogg')
|
||||
#goodexts = ('.mp3', '.mp2', '.m4a', '.flac', '.ogg')
|
||||
goodexts = ('.mp3', '.flac', '.ogg')
|
||||
|
||||
matchtags = ['artist', 'album', 'title']
|
||||
alltags = [\
|
||||
|
@ -123,8 +124,12 @@ def run(args):
|
|||
elif updatemetadata(md, match):
|
||||
print("UPD", p)
|
||||
md.md.save()
|
||||
else:
|
||||
print("___", p)
|
||||
|
||||
lament("[beginning tosync]")
|
||||
for md in tosync:
|
||||
#print("SYN", md.path)
|
||||
fn = makefilename(md)
|
||||
fout = os.path.join(outdir, fn)
|
||||
|
||||
|
@ -161,9 +166,10 @@ def run(args):
|
|||
|
||||
return 0
|
||||
|
||||
ret = 0
|
||||
try:
|
||||
ret = run(sys.argv)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
sys.exit(ret)
|
||||
if __name__ == '__main__':
|
||||
ret = 0
|
||||
try:
|
||||
ret = run(sys.argv)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
sys.exit(ret)
|
||||
|
|
Loading…
Reference in a new issue