mirror of
https://github.com/beetbox/beets.git
synced 2026-02-22 23:33:50 +01:00
early exit; add data_source
This commit is contained in:
parent
2db0796fad
commit
2e916404f9
1 changed files with 7 additions and 1 deletions
|
|
@ -195,6 +195,10 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
if not self.discogs_client:
|
||||
return
|
||||
|
||||
if not artist and not title:
|
||||
self._log.debug('Skipping Discogs query. File missing artist and '
|
||||
'title tags.')
|
||||
|
||||
query = f'{artist} {title}'
|
||||
try:
|
||||
albums = self.get_albums(query)
|
||||
|
|
@ -212,12 +216,14 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
self._log.debug(u'searching within album {0}', album_cur.album)
|
||||
track_list = self.get_tracks_from_album(album_cur)
|
||||
candidates += track_list
|
||||
for candidate in candidates:
|
||||
candidate.data_source = 'Discogs'
|
||||
return candidates
|
||||
|
||||
def get_tracks_from_album(self, album_info):
|
||||
"""Return a list of tracks in the release
|
||||
"""
|
||||
if not album_info:
|
||||
if not album_info:
|
||||
return []
|
||||
|
||||
result = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue