Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
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)