def tracks_for_id(track_id): """Get a list of tracks for an ID.""" candidates = [track_for_mbid(track_id)] plugin_tracks = plugins.track_for_id(track_id) for t in plugin_tracks: plugins.send('trackinfo_received', info=t) candidates.extend(plugin_tracks) return filter(None, candidates)
def tracks_for_id(track_id): """Get a list of tracks for an ID.""" t = track_for_mbid(track_id) if t: yield t for t in plugins.track_for_id(track_id): if t: yield t
def tracks_for_id(track_id): """Get a list of tracks for an ID.""" t = track_for_mbid(track_id) if t: yield t for t in plugins.track_for_id(track_id): if t: plugins.send(u'trackinfo_received', info=t) yield t
def _track_for_id(track_id): """Get an item for a recording ID.""" candidates = [] # From MusicBrainz. try: candidates.append(mb.track_for_id(track_id)) except mb.MusicBrainzAPIError as exc: exc.log(log) # From plugins. candidates.extend(plugins.track_for_id(track_id)) return filter(None, candidates)
def tracks_for_id(track_id): """ Get a list of tracks for an ID. Returns a list like [track_info, album_info] """ t = track_for_mbid(track_id) if t: yield TrackAlbumTuple(t, None) for t in plugins.track_for_id(track_id): if not t: continue plugins.send(u'trackinfo_received', info=t) # allow (track_info, album_info) tuples if isinstance(t, TrackAlbumTuple): yield t else: yield TrackAlbumTuple(t, None)
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)) return filter(None, candidates)