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_ALBUM, 'name', album_kwargs)
|
||||||
_retrieve(gst.TAG_TRACK_COUNT, 'num_tracks', 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)
|
_retrieve(gst.TAG_ARTIST, 'name', artist_kwargs)
|
||||||
|
|
||||||
if gst.TAG_DATE in data and data[gst.TAG_DATE]:
|
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_TITLE, 'name', track_kwargs)
|
||||||
_retrieve(gst.TAG_TRACK_NUMBER, 'track_no', 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.
|
# Following keys don't seem to have TAG_* constant.
|
||||||
_retrieve('album-artist', 'name', albumartist_kwargs)
|
_retrieve('album-artist', 'name', albumartist_kwargs)
|
||||||
|
|||||||
@ -26,6 +26,8 @@ class TranslatorTest(unittest.TestCase):
|
|||||||
'album-artist': 'albumartistname',
|
'album-artist': 'albumartistname',
|
||||||
'title': 'trackname',
|
'title': 'trackname',
|
||||||
'track-count': 2,
|
'track-count': 2,
|
||||||
|
'album-disc-number': 2,
|
||||||
|
'album-disc-count': 3,
|
||||||
'date': FakeGstDate(2006, 1, 1,),
|
'date': FakeGstDate(2006, 1, 1,),
|
||||||
'container-format': 'ID3 tag',
|
'container-format': 'ID3 tag',
|
||||||
'duration': 4531,
|
'duration': 4531,
|
||||||
@ -39,6 +41,7 @@ class TranslatorTest(unittest.TestCase):
|
|||||||
self.album = {
|
self.album = {
|
||||||
'name': 'albumname',
|
'name': 'albumname',
|
||||||
'num_tracks': 2,
|
'num_tracks': 2,
|
||||||
|
'num_discs': 3,
|
||||||
'musicbrainz_id': 'mbalbumid',
|
'musicbrainz_id': 'mbalbumid',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +59,8 @@ class TranslatorTest(unittest.TestCase):
|
|||||||
'uri': 'uri',
|
'uri': 'uri',
|
||||||
'name': 'trackname',
|
'name': 'trackname',
|
||||||
'date': '2006-01-01',
|
'date': '2006-01-01',
|
||||||
'track_no': 1,
|
'track_no': 1,
|
||||||
|
'disc_no': 2,
|
||||||
'length': 4531,
|
'length': 4531,
|
||||||
'musicbrainz_id': 'mbtrackid',
|
'musicbrainz_id': 'mbtrackid',
|
||||||
'last_modified': 1234,
|
'last_modified': 1234,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user