mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 12:35:19 +01:00
lastgenre: force real lookup during import only if no custom whitelist set.
This commit is contained in:
parent
7f17266a6e
commit
4be30fca2e
1 changed files with 4 additions and 3 deletions
|
|
@ -39,6 +39,7 @@ log = logging.getLogger('beets')
|
|||
|
||||
LASTFM = pylast.LastFMNetwork(api_key=plugins.LASTFM_KEY)
|
||||
C14N_TREE = os.path.join(os.path.dirname(__file__), 'genres-tree.yaml')
|
||||
WHITELIST = os.path.join(os.path.dirname(__file__), 'genres.txt')
|
||||
|
||||
PYLAST_EXCEPTIONS = (
|
||||
pylast.WSError,
|
||||
|
|
@ -198,7 +199,7 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
super(LastGenrePlugin, self).__init__()
|
||||
|
||||
self.config.add({
|
||||
'whitelist': os.path.join(os.path.dirname(__file__), 'genres.txt'),
|
||||
'whitelist': WHITELIST,
|
||||
'fallback': None,
|
||||
'canonical': None,
|
||||
'source': 'album',
|
||||
|
|
@ -347,8 +348,8 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
|
||||
def imported(self, session, task):
|
||||
"""Event hook called when an import task finishes."""
|
||||
# Always force a "real" lookup during import.
|
||||
if not self.config['force']:
|
||||
# Force a "real" lookup during import if no custom whitelist set
|
||||
if self.config['whitelist'].get() == WHITELIST:
|
||||
self.config['force'] = True
|
||||
|
||||
if task.is_album:
|
||||
|
|
|
|||
Loading…
Reference in a new issue