Auto-tagging only the artist field of imported tracks without moving or copying #6944
|
I have a few compilation albums with incorrectly tagged artists (e.g., Beatles instead of The Beatles). I tried to re-import in singleton mode pointing to the compilation album path but it changes the album name as well. My config file: |
Replies: 2 comments 3 replies
|
No per-field import mode, the importer is all-or-nothing. Two options. If the album has MusicBrainz IDs: Skips the importer, but still refreshes every field it knows. For one field only, don't auto-tag at all:
Your |
|
You can do this safely as a small local plugin. I would not treat a string-similarity percentage as a confidence probability. Beets already has a weighted matcher and a This is a dry run unless from beets import ui
from beets.autotag import Recommendation, Source, tag_item
from beets.plugins import BeetsPlugin
class ArtistOnlyPlugin(BeetsPlugin):
def commands(self):
cmd = ui.Subcommand(
"artistonly",
help="propose MusicBrainz artist corrections without moving files",
)
cmd.parser.add_option(
"--apply",
action="store_true",
default=False,
help="apply strong MusicBrainz matches; otherwise dry-run",
)
cmd.parser.add_option("-w", "--write", action="store_true", default=None)
cmd.parser.add_option("-W", "--nowrite", action="store_false", dest="write")
cmd.func = self.command
return [cmd]
def command(self, lib, opts, args):
write = ui.should_write(opts.write)
for item in lib.items(args):
proposal = tag_item(Source.from_item(item))
if not proposal.candidates or proposal.recommendation != Recommendation.strong:
self._log.info("SKIP (no strong match): {} - {}", item.artist, item.title)
continue
match = proposal.candidates[0]
if match.info.data_source != "MusicBrainz":
self._log.info(
"SKIP (best source is {}): {} - {}",
match.info.data_source,
item.artist,
item.title,
)
continue
new_artist = match.info.artist
if not new_artist or new_artist == item.artist:
continue
self._log.info("{} - {} => {}", item.artist, item.title, new_artist)
if opts.apply:
item.artist = new_artist
if write:
item.try_write()
item.store()Save it as # Preview one compilation first
beet artistonly album:"Album Name"
# Update the database and file tags
beet artistonly --apply album:"Album Name"
# Update only the database, not file tags
beet artistonly --apply -W album:"Album Name"This never calls |
You can do this safely as a small local plugin. I would not treat a string-similarity percentage as a confidence probability. Beets already has a weighted matcher and a
Recommendation.strongthreshold, so I would reuse that and only changeartistafter a strong MusicBrainz result.This is a dry run unless
--applyis supplied: