AlbumMatch and TrackMatch types

These new named tuples will represent candidates given by the autotagging
system. In the case of album matches, these are currently unwieldy,
verbosely-documented tuples that will only get more unwieldy with the addition
of "unmatched tracks".
This commit is contained in:
Adrian Sampson 2012-06-29 15:06:05 -07:00
parent 98d46be4a5
commit 8d7397135f

View file

@ -14,11 +14,14 @@
"""Glue between metadata sources and the matching logic."""
import logging
from collections import namedtuple
from beets import plugins
from beets.autotag import mb
log = logging.getLogger('beets')
# Classes used to represent candidate options.
class AlbumInfo(object):
@ -117,6 +120,11 @@ class TrackInfo(object):
self.disctitle = disctitle
self.artist_credit = artist_credit
AlbumMatch = namedtuple('AlbumMatch', ['distance', 'info', 'mapping',
'extra_items', 'extra_tracks'])
TrackMatch = namedtuple('TrackMatch', ['distance', 'info'])
# Aggregation of sources.