mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
add tag, database entry, data population for musicbrainz release track id
This commit is contained in:
parent
fee4dd1a68
commit
0f6f0391fd
7 changed files with 16 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ def apply_item_metadata(item, track_info):
|
|||
item.artist_credit = track_info.artist_credit
|
||||
item.title = track_info.title
|
||||
item.mb_trackid = track_info.track_id
|
||||
item.mb_releasetrackid = track_info.release_track_id
|
||||
if track_info.artist_id:
|
||||
item.mb_artistid = track_info.artist_id
|
||||
if track_info.data_source:
|
||||
|
|
@ -122,6 +123,7 @@ def apply_metadata(album_info, mapping):
|
|||
|
||||
# MusicBrainz IDs.
|
||||
item.mb_trackid = track_info.track_id
|
||||
item.mb_releasetrackid = track_info.release_track_id
|
||||
item.mb_albumid = album_info.album_id
|
||||
if track_info.artist_id:
|
||||
item.mb_artistid = track_info.artist_id
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ class TrackInfo(object):
|
|||
|
||||
- ``title``: name of the track
|
||||
- ``track_id``: MusicBrainz ID; UUID fragment only
|
||||
- ``release_track_id``: MusicBrainz ID respective to a track on a
|
||||
particular release; UUID fragment only
|
||||
- ``artist``: individual track artist name
|
||||
- ``artist_id``
|
||||
- ``length``: float: duration of the track in seconds
|
||||
|
|
@ -152,7 +154,7 @@ class TrackInfo(object):
|
|||
may be None. The indices ``index``, ``medium``, and ``medium_index``
|
||||
are all 1-based.
|
||||
"""
|
||||
def __init__(self, title, track_id, artist=None, artist_id=None,
|
||||
def __init__(self, title, track_id, release_track_id=None, artist=None, artist_id=None,
|
||||
length=None, index=None, medium=None, medium_index=None,
|
||||
medium_total=None, artist_sort=None, disctitle=None,
|
||||
artist_credit=None, data_source=None, data_url=None,
|
||||
|
|
@ -160,6 +162,7 @@ class TrackInfo(object):
|
|||
arranger=None, track_alt=None):
|
||||
self.title = title
|
||||
self.track_id = track_id
|
||||
self.release_track_id = release_track_id
|
||||
self.artist = artist
|
||||
self.artist_id = artist_id
|
||||
self.length = length
|
||||
|
|
|
|||
|
|
@ -304,6 +304,7 @@ def album_info(release):
|
|||
int(track['position']),
|
||||
len(medium['track-list']),
|
||||
)
|
||||
ti.release_track_id = track['id']
|
||||
ti.disctitle = disctitle
|
||||
ti.media = format
|
||||
ti.track_alt = track['number']
|
||||
|
|
|
|||
|
|
@ -455,6 +455,7 @@ class Item(LibModel):
|
|||
'mb_albumid': types.STRING,
|
||||
'mb_artistid': types.STRING,
|
||||
'mb_albumartistid': types.STRING,
|
||||
'mb_releasetrackid': types.STRING,
|
||||
'albumtype': types.STRING,
|
||||
'label': types.STRING,
|
||||
'acoustid_fingerprint': types.STRING,
|
||||
|
|
|
|||
|
|
@ -1865,6 +1865,12 @@ class MediaFile(object):
|
|||
StorageStyle('MUSICBRAINZ_TRACKID'),
|
||||
ASFStorageStyle('MusicBrainz/Track Id'),
|
||||
)
|
||||
mb_releasetrackid = MediaField(
|
||||
MP3DescStorageStyle(u'MusicBrainz Release Track Id'),
|
||||
MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Release Track Id'),
|
||||
StorageStyle('MUSICBRAINZ_RELEASETRACKID'),
|
||||
ASFStorageStyle('MusicBrainz/Release Track Id'),
|
||||
)
|
||||
mb_albumid = MediaField(
|
||||
MP3DescStorageStyle(u'MusicBrainz Album Id'),
|
||||
MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Album Id'),
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ Audio information:
|
|||
MusicBrainz and fingerprint information:
|
||||
|
||||
* mb_trackid
|
||||
* mb_releasetrackid
|
||||
* mb_albumid
|
||||
* mb_artistid
|
||||
* mb_albumartistid
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ def item(lib=None):
|
|||
mb_albumid='someID-2',
|
||||
mb_artistid='someID-3',
|
||||
mb_albumartistid='someID-4',
|
||||
mb_releasetrackid='someID-5',
|
||||
album_id=None,
|
||||
mtime=12345,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue