Scanner: Add disc number to album and track models (fixes #318)
This commit is contained in:
parent
73f47a9fce
commit
a372df8333
@ -139,6 +139,7 @@ def translator(data):
|
||||
|
||||
_retrieve(gst.TAG_ALBUM, 'name', album_kwargs)
|
||||
_retrieve(gst.TAG_TRACK_COUNT, 'num_tracks', album_kwargs)
|
||||
_retrieve(gst.TAG_ALBUM_VOLUME_COUNT, 'num_discs', album_kwargs)
|
||||
_retrieve(gst.TAG_ARTIST, 'name', artist_kwargs)
|
||||
|
||||
if gst.TAG_DATE in data and data[gst.TAG_DATE]:
|
||||
@ -152,6 +153,7 @@ def translator(data):
|
||||
|
||||
_retrieve(gst.TAG_TITLE, 'name', track_kwargs)
|
||||
_retrieve(gst.TAG_TRACK_NUMBER, 'track_no', track_kwargs)
|
||||
_retrieve(gst.TAG_ALBUM_VOLUME_NUMBER, 'disc_no', track_kwargs)
|
||||
|
||||
# Following keys don't seem to have TAG_* constant.
|
||||
_retrieve('album-artist', 'name', albumartist_kwargs)
|
||||
|
||||
@ -26,6 +26,8 @@ class TranslatorTest(unittest.TestCase):
|
||||
'album-artist': 'albumartistname',
|
||||
'title': 'trackname',
|
||||
'track-count': 2,
|
||||
'album-disc-number': 2,
|
||||
'album-disc-count': 3,
|
||||
'date': FakeGstDate(2006, 1, 1,),
|
||||
'container-format': 'ID3 tag',
|
||||
'duration': 4531,
|
||||
@ -39,6 +41,7 @@ class TranslatorTest(unittest.TestCase):
|
||||
self.album = {
|
||||
'name': 'albumname',
|
||||
'num_tracks': 2,
|
||||
'num_discs': 3,
|
||||
'musicbrainz_id': 'mbalbumid',
|
||||
}
|
||||
|
||||
@ -56,7 +59,8 @@ class TranslatorTest(unittest.TestCase):
|
||||
'uri': 'uri',
|
||||
'name': 'trackname',
|
||||
'date': '2006-01-01',
|
||||
'track_no': 1,
|
||||
'track_no': 1,
|
||||
'disc_no': 2,
|
||||
'length': 4531,
|
||||
'musicbrainz_id': 'mbtrackid',
|
||||
'last_modified': 1234,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user