From babc0bcfdfabbe17059592d04af0b7b258d23c4c Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Sun, 25 May 2008 18:55:02 -0400 Subject: [PATCH] add replaygain to files when copied during sync, fixed problem with calc_replaygain+apply on files --- audiomangler/codecs.py | 7 +++++-- audiomangler/tag.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/audiomangler/codecs.py b/audiomangler/codecs.py index 866818b..07813d3 100644 --- a/audiomangler/codecs.py +++ b/audiomangler/codecs.py @@ -130,9 +130,8 @@ class Codec(object): for trackfile,trackgain in zip(files,tracks): f = File(trackfile) m = NormMetaData(trackgain + album) - m.update(trackgain) - m.update(album) m.apply(f) + f.save() class MP3Codec(Codec): @@ -422,6 +421,10 @@ def sync_sets(sets=[],targettids=()): os.makedirs(targetdir) print "%s -> %s" % (i.filename,t) util.copy(i.filename,t) + codecs = set((get_codec(f) for f in fileset)) + codec = codecs.pop() + if codec and not codecs and codec._replaygain: + codec.add_replaygain(targetfiles) check_and_copy_cover(fileset,targetfiles) continue postadd = {'type':targetcodec.type_,'ext':targetcodec.ext} diff --git a/audiomangler/tag.py b/audiomangler/tag.py index a8345a0..115419e 100644 --- a/audiomangler/tag.py +++ b/audiomangler/tag.py @@ -542,6 +542,7 @@ class NormMetaData(dict): if itemtrans: target.tags.update(itemtrans(k,v) for k,v in newmeta.items()) else: + print newmeta target.tags.update(newmeta) __all__ = ['NormMetaData'] \ No newline at end of file -- 2.11.4.GIT