summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bac901c)
- read: support a tag appearing with the same value on a subset of tracks and
nowhere else; previously this was ok if the value were differnet, but if say
only a few tracks had VERSION=radio and the rest had no VERSION, VERSION
would erroneously become a global tag
- write: support each track having own ALBUM with on global ALBUm (e.g. most
tracks are 'album=foo' but a few are 'album=foo extended'); previously broke
as ALBUm had to be global
- bonus: i noticed write was also missing ALBUMARTIST; added
coll_tags.set(tag, value, track)
for tag, values in all_tags.iteritems():
if len(values) == 1:
coll_tags.set(tag, value, track)
for tag, values in all_tags.iteritems():
if len(values) == 1:
- # Only one value for this tag, so add it to global tags.
- coll_tags.set(tag, list(values)[0])
- # And now remove it from each track tags.
+ # Only one value for this tag, but does that one value appear on
+ # all tracks?
for track, tags in coll_tags._tracks.iteritems():
for track, tags in coll_tags._tracks.iteritems():
+ if not tag in tags:
+ # Nope.
+ break
+ else:
+ # Yep, so add it to global tags.
+ coll_tags.set(tag, list(values)[0])
+ # And now remove it from each track tags.
+ for track, tags in coll_tags._tracks.iteritems():
+ del tags[tag]
print '\n'.join(coll_tags.all())
return 0
print '\n'.join(coll_tags.all())
return 0
sys.stderr.write('expected %d flac files, got %d\n'
% (len(tags), len(args)))
return 2
sys.stderr.write('expected %d flac files, got %d\n'
% (len(tags), len(args)))
return 2
- artist = tags.get_path_safe('ARTIST')
+ artist = tags.get_path_safe('ALBUMARTIST')
+ if not artist:
+ artist = tags.get_path_safe('ARTIST')
album = tags.get_path_safe('ALBUM')
album = tags.get_path_safe('ALBUM')
+ if not album:
+ album = tags.get_path_safe('ALBUM', track=1)
try:
os.mkdir(artist)
except OSError, e:
try:
os.mkdir(artist)
except OSError, e: