From 485870f2888bc42fd2b521847fac802640524a0b Mon Sep 17 00:00:00 2001 From: Manfred Urban Date: Sun, 8 Nov 2015 16:22:36 +0100 Subject: [PATCH] Made various artist title configurable --- beets/autotag/mb.py | 2 ++ beets/config_default.yaml | 1 + beetsplug/discogs.py | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index 8589a62aa..78c5fb2f4 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -259,6 +259,8 @@ def album_info(release): data_url=album_url(release['id']), ) info.va = info.artist_id == VARIOUS_ARTISTS_ID + if info.va: + info.artist = config['va_name'].get(unicode) info.asin = release.get('asin') info.releasegroup_id = release['release-group']['id'] info.country = release.get('country') diff --git a/beets/config_default.yaml b/beets/config_default.yaml index f708702a8..ba58debe7 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -47,6 +47,7 @@ verbose: 0 terminal_encoding: original_date: no id3v23: no +va_name: "Various Artists" ui: terminal_width: 80 diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index c19e65a2f..2a90cdafe 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -20,6 +20,7 @@ from __future__ import (division, absolute_import, print_function, import beets.ui from beets import logging +from beets import config from beets.autotag.hooks import AlbumInfo, TrackInfo, Distance from beets.plugins import BeetsPlugin from beets.util import confit @@ -55,8 +56,7 @@ class DiscogsPlugin(BeetsPlugin): 'apikey': 'rAzVUQYRaoFjeBjyWuWZ', 'apisecret': 'plxtUTqoCzwxZpqdPysCwGuBSmZNdZVy', 'tokenfile': 'discogs_token.json', - 'source_weight': 0.5, - 'va_name': 'Various Artists', + 'source_weight': 0.5 }) self.config['apikey'].redact = True self.config['apisecret'].redact = True @@ -225,7 +225,7 @@ class DiscogsPlugin(BeetsPlugin): result.data['formats'][0].get('descriptions', [])) or None va = result.data['artists'][0]['name'].lower() == 'various' if va: - artist = self.config['va_name'].get() + artist = config['va_name'].get(unicode) year = result.data['year'] label = result.data['labels'][0]['name'] mediums = len(set(t.medium for t in tracks))