mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
Needed to find new spot to emit events because hooks.*_for_id -methods are only called when searching for explicit IDs
This commit is contained in:
parent
e9ddb92c2d
commit
b2efd60162
2 changed files with 12 additions and 4 deletions
|
|
@ -530,8 +530,6 @@ def albums_for_id(album_id):
|
|||
"""Get a list of albums for an ID."""
|
||||
candidates = [album_for_mbid(album_id)]
|
||||
candidates.extend(plugins.album_for_id(album_id))
|
||||
for a in candidates:
|
||||
plugins.send('albuminfo_received', info=a)
|
||||
return filter(None, candidates)
|
||||
|
||||
|
||||
|
|
@ -539,8 +537,6 @@ def tracks_for_id(track_id):
|
|||
"""Get a list of tracks for an ID."""
|
||||
candidates = [track_for_mbid(track_id)]
|
||||
candidates.extend(plugins.track_for_id(track_id))
|
||||
for t in candidates:
|
||||
plugins.send('trackinfo_received', info=t)
|
||||
return filter(None, candidates)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -350,6 +350,10 @@ def _add_candidate(items, results, info):
|
|||
log.debug(u'Ignored. Missing required tag: {0}', req_tag)
|
||||
return
|
||||
|
||||
# Notify subscribed plugins about fetched album info and let them perform
|
||||
# their manipulations
|
||||
plugins.send('albuminfo_received', info=info)
|
||||
|
||||
# Find mapping between the items and the track info.
|
||||
mapping, extra_items, extra_tracks = assign_items(items, info.tracks)
|
||||
|
||||
|
|
@ -459,6 +463,10 @@ def tag_item(item, search_artist=None, search_title=None,
|
|||
if trackid:
|
||||
log.debug(u'Searching for track ID: {0}', trackid)
|
||||
for track_info in hooks.tracks_for_id(trackid):
|
||||
# Notify subscribed plugins about fetched track info and let them perform
|
||||
# their manipulations
|
||||
plugins.send('trackinfo_received', info=track_info)
|
||||
|
||||
dist = track_distance(item, track_info, incl_artist=True)
|
||||
candidates[track_info.track_id] = \
|
||||
hooks.TrackMatch(dist, track_info)
|
||||
|
|
@ -482,6 +490,10 @@ def tag_item(item, search_artist=None, search_title=None,
|
|||
|
||||
# Get and evaluate candidate metadata.
|
||||
for track_info in hooks.item_candidates(item, search_artist, search_title):
|
||||
# Notify subscribed plugins about fetched track info and let them perform
|
||||
# their manipulations
|
||||
plugins.send('trackinfo_received', info=track_info)
|
||||
|
||||
dist = track_distance(item, track_info, incl_artist=True)
|
||||
candidates[track_info.track_id] = hooks.TrackMatch(dist, track_info)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue