This commit is contained in:
Connor Olding 2014-11-02 10:12:52 -08:00
parent c61c00dfd6
commit d4fbd7a829
2 changed files with 15 additions and 7 deletions

View file

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

View file

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