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
|
self.seen = False
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
|
if self.md == None:
|
||||||
|
print(self.path)
|
||||||
d = self.md[key]
|
d = self.md[key]
|
||||||
try:
|
try:
|
||||||
return d[0]
|
return d[0]
|
||||||
|
|
20
unsync.py
20
unsync.py
|
@ -15,7 +15,8 @@ import convert
|
||||||
from mutaext import SyncFile
|
from mutaext import SyncFile
|
||||||
|
|
||||||
# BUG: doesn't work with my .m4a files?
|
# 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']
|
matchtags = ['artist', 'album', 'title']
|
||||||
alltags = [\
|
alltags = [\
|
||||||
|
@ -123,8 +124,12 @@ def run(args):
|
||||||
elif updatemetadata(md, match):
|
elif updatemetadata(md, match):
|
||||||
print("UPD", p)
|
print("UPD", p)
|
||||||
md.md.save()
|
md.md.save()
|
||||||
|
else:
|
||||||
|
print("___", p)
|
||||||
|
|
||||||
|
lament("[beginning tosync]")
|
||||||
for md in tosync:
|
for md in tosync:
|
||||||
|
#print("SYN", md.path)
|
||||||
fn = makefilename(md)
|
fn = makefilename(md)
|
||||||
fout = os.path.join(outdir, fn)
|
fout = os.path.join(outdir, fn)
|
||||||
|
|
||||||
|
@ -161,9 +166,10 @@ def run(args):
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
ret = 0
|
if __name__ == '__main__':
|
||||||
try:
|
ret = 0
|
||||||
ret = run(sys.argv)
|
try:
|
||||||
except KeyboardInterrupt:
|
ret = run(sys.argv)
|
||||||
sys.exit(1)
|
except KeyboardInterrupt:
|
||||||
sys.exit(ret)
|
sys.exit(1)
|
||||||
|
sys.exit(ret)
|
||||||
|
|
Loading…
Add table
Reference in a new issue