Repository navigation
Confused about 'trackc' and 'discc' fields that are getting added #7071
|
I am new to beets, but have it setup and working - somewhat. I did notice that in MyMPD UI all my tracks started showing up with two track numbers as well as counts (for ex: tl;dr - how do you filter out tags w/ beets, I do not want to have to specify a whitelist Here's my config... |
Replies: 1 comment 1 reply
|
Those extra keys are written on purpose, by the mediafile library beets uses for tagging, not by your config. For FLAC/Ogg it writes the track number as both There is no option to switch the duplicates off, but a tiny local plugin can drop them right after beets writes a file: # ~/.config/beets/plugins/dedupetags.py
import mutagen
from beets.plugins import BeetsPlugin
DROP = ("track", "trackc", "totaltracks", "discc", "totaldiscs")
class DedupeTags(BeetsPlugin):
def __init__(self):
super().__init__()
self.register_listener("after_write", self.after_write)
def after_write(self, item, path):
f = mutagen.File(path)
if f is None or f.tags is None or not hasattr(f.tags, "keys"):
return
changed = False
for key in DROP:
if key in f.tags: # Vorbis comment keys are case-insensitive
del f.tags[key]
changed = True
if changed:
f.save()pluginpath: ~/.config/beets/plugins
plugins: ... dedupetagsThat keeps |
Those extra keys are written on purpose, by the mediafile library beets uses for tagging, not by your config. For FLAC/Ogg it writes the track number as both
TRACKandTRACKNUMBER, and the total asTRACKTOTAL,TRACKCandTOTALTRACKS(same for discs:DISCTOTAL,DISCC,TOTALDISCS). Its docs say it accepts any of the keys and writes all of them so players that disagree on the name still find one. That is also whyscrubandzerodo not help: they work per beets field, and all of those keys are the same field to beets.There is no option to switch the duplicates off, but a tiny local plugin can drop them right after beets writes a file: