Skip to content

Commit

Permalink
Add Release Group MBIDs to ripped files
Browse files Browse the repository at this point in the history
See https://musicbrainz.org/doc/Release_Group

Second part of #200

(MusicBrainz JSON test data dumps needed to be refreshed due to the
new `includes` in the MusicBrainz web service call.)

Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
  • Loading branch information
Freso committed Feb 13, 2019
1 parent 41b1b1f commit c963b01
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion whipper/common/mbngs.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class DiscMetadata(object):
releaseType = None

mbid = None
mbidReleaseGroup = None
mbidArtist = None
url = None

Expand Down Expand Up @@ -189,6 +190,7 @@ def _getMetadata(releaseShort, release, discid, country=None):
discMD.release = release['date']

discMD.mbid = release['id']
discMD.mbidReleaseGroup = release['release-group']['id']
discMD.mbidArtist = discCredit.getIds()
discMD.url = 'https://musicbrainz.org/release/' + release['id']

Expand Down Expand Up @@ -305,7 +307,8 @@ def musicbrainz(discid, country=None, record=False):

res = musicbrainzngs.get_release_by_id(
release['id'], includes=["artists", "artist-credits",
"recordings", "discids", "labels"])
"recordings", "discids", "labels",
"release-groups"])
_record(record, 'release', release['id'], res)
releaseDetail = res['release']
formatted = json.dumps(releaseDetail, sort_keys=False, indent=4)
Expand Down
2 changes: 2 additions & 0 deletions whipper/common/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def getTagList(self, number, mbdiscid):
releaseArtist = self.metadata.artist
disc = self.metadata.title
mbidRelease = self.metadata.mbid
mbidReleaseGroup = self.metadata.mbidReleaseGroup
mbidReleaseArtist = self.metadata.mbidArtist

if number > 0:
Expand Down Expand Up @@ -425,6 +426,7 @@ def getTagList(self, number, mbdiscid):
tags['MUSICBRAINZ_TRACKID'] = mbidRecording
tags['MUSICBRAINZ_ARTISTID'] = mbidTrackArtist
tags['MUSICBRAINZ_ALBUMID'] = mbidRelease
tags['MUSICBRAINZ_RELEASEGROUPID'] = mbidReleaseGroup
tags['MUSICBRAINZ_ALBUMARTISTID'] = mbidReleaseArtist

# TODO/FIXME: ISRC tag
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"release": {"status": "Official", "artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "barcode": "5050466625021", "asin": "B000095K86", "label-info-count": 1, "label-info-list": [{"catalog-number": "5050466-6250-2-1", "label": {"sort-name": "Warner Strategic Marketing", "label-code": "2828", "id": "640ea9b1-3811-4c06-8897-5918c16f9fe1", "name": "Warner Strategic Marketing"}}], "cover-art-archive": {"count": "2", "front": "true", "back": "true", "artwork": "true"}, "release-event-list": [{"date": "2003-05-19", "area": {"sort-name": "Germany", "iso-3166-1-code-list": ["DE"], "id": "85752fda-13c4-31a3-bee5-0e5cb1f51dad", "name": "Germany"}}], "packaging": "Slim Jewel Case", "text-representation": {"language": "deu", "script": "Latn"}, "date": "2003-05-19", "quality": "normal", "id": "f484a9fc-db21-4106-9408-bcd105c90047", "release-event-count": 1, "title": "Anyplace, Anywhere, Anytime", "country": "DE", "medium-count": 1, "artist-credit-phrase": "Nena & Kim Wilde", "medium-list": [{"position": "1", "track-count": 4, "format": "CD", "disc-list": [{"offset-list": [150, 17037, 35418, 53803], "id": "X2c2IQ5vUy5x6Jh7Xi_DGHtA1X8-", "sectors": "66872", "offset-count": 4}], "track-list": [{"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "number": "1", "artist-credit-phrase": "Nena & Kim Wilde", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "length": "223000", "artist-credit-phrase": "Nena & Kim Wilde", "id": "fde5622c-ce23-4ebb-975d-51d4a926f901", "title": "Anyplace, Anywhere, Anytime (radio version)"}, "length": "225160", "position": "1", "id": "1cc96e78-28ed-3820-b0b6-614c35b121ac", "track_or_recording_length": "225160"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " mit ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "length": "243453", "artist-credit-phrase": "Nena mit Kim Wilde", "id": "5f19758e-7421-4c71-a599-9a9575d8e1b0", "title": "Anyplace, Anywhere, Anytime (new version)"}, "length": "245080", "position": "2", "artist-credit-phrase": "Nena & Kim Wilde", "track_or_recording_length": "245080", "id": "f16db4bf-9a34-3d5a-a975-c9375ab7a2ca", "number": "2"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "number": "3", "artist-credit-phrase": "Nena", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "length": "243266", "artist-credit-phrase": "Nena", "id": "32706323-1a08-4c7e-bf21-9a44934498ba", "title": "Irgendwie, irgendwo, irgendwann (new version)"}, "length": "245133", "position": "3", "id": "ce2c4edd-6eab-36c8-8f84-e8c85f197a88", "track_or_recording_length": "245133"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "number": "4", "artist-credit-phrase": "Nena", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "length": "175440", "artist-credit-phrase": "Nena", "id": "ea70231c-cc03-4900-9a5a-43afb18ed638", "title": "Nur getr\u00e4umt (new version)"}, "length": "173627", "position": "4", "id": "6e178989-7d8e-3c33-9628-50bdda7c4483", "track_or_recording_length": "173627"}], "disc-count": 1}]}}
{"release": {"status": "Official", "artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "barcode": "5050466625021", "asin": "B000095K86", "label-info-count": 1, "label-info-list": [{"catalog-number": "5050466-6250-2-1", "label": {"sort-name": "Warner Strategic Marketing", "label-code": "2828", "id": "640ea9b1-3811-4c06-8897-5918c16f9fe1", "name": "Warner Strategic Marketing"}}], "cover-art-archive": {"count": "2", "front": "true", "back": "true", "artwork": "true"}, "release-event-list": [{"date": "2003-05-19", "area": {"sort-name": "Germany", "iso-3166-1-code-list": ["DE"], "id": "85752fda-13c4-31a3-bee5-0e5cb1f51dad", "name": "Germany"}}], "packaging": "Slim Jewel Case", "text-representation": {"language": "deu", "script": "Latn"}, "date": "2003-05-19", "quality": "normal", "id": "f484a9fc-db21-4106-9408-bcd105c90047", "release-event-count": 1, "title": "Anyplace, Anywhere, Anytime", "country": "DE", "medium-count": 1, "artist-credit-phrase": "Nena & Kim Wilde", "release-group": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "first-release-date": "2003-05-19", "primary-type": "Single", "title": "Anyplace, Anywhere, Anytime", "type": "Single", "id": "3bbf5f32-dbef-3fe8-b4b4-c52d63abf282", "artist-credit-phrase": "Nena & Kim Wilde"}, "medium-list": [{"position": "1", "track-count": 4, "format": "CD", "disc-list": [{"offset-list": [150, 17037, 35418, 53803], "id": "X2c2IQ5vUy5x6Jh7Xi_DGHtA1X8-", "sectors": "66872", "offset-count": 4}], "track-list": [{"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "number": "1", "artist-credit-phrase": "Nena & Kim Wilde", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "length": "223000", "artist-credit-phrase": "Nena & Kim Wilde", "id": "fde5622c-ce23-4ebb-975d-51d4a926f901", "title": "Anyplace, Anywhere, Anytime (radio version)"}, "length": "225160", "position": "1", "id": "1cc96e78-28ed-3820-b0b6-614c35b121ac", "track_or_recording_length": "225160"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " & ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}, " mit ", {"artist": {"sort-name": "Wilde, Kim", "id": "4b462375-c508-432a-8c88-ceeec38b16ae", "name": "Kim Wilde"}}], "length": "243453", "artist-credit-phrase": "Nena mit Kim Wilde", "id": "5f19758e-7421-4c71-a599-9a9575d8e1b0", "title": "Anyplace, Anywhere, Anytime (new version)"}, "length": "245080", "position": "2", "artist-credit-phrase": "Nena & Kim Wilde", "track_or_recording_length": "245080", "id": "f16db4bf-9a34-3d5a-a975-c9375ab7a2ca", "number": "2"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "number": "3", "artist-credit-phrase": "Nena", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "length": "243266", "artist-credit-phrase": "Nena", "id": "32706323-1a08-4c7e-bf21-9a44934498ba", "title": "Irgendwie, irgendwo, irgendwann (new version)"}, "length": "245133", "position": "3", "id": "ce2c4edd-6eab-36c8-8f84-e8c85f197a88", "track_or_recording_length": "245133"}, {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "number": "4", "artist-credit-phrase": "Nena", "recording": {"artist-credit": [{"artist": {"sort-name": "Nena", "disambiguation": "the person, performing solo since 1987", "id": "38bfaa7f-ee98-48cb-acd0-946d7aeecd76", "name": "Nena"}}], "length": "175440", "artist-credit-phrase": "Nena", "id": "ea70231c-cc03-4900-9a5a-43afb18ed638", "title": "Nur getr\u00e4umt (new version)"}, "length": "173627", "position": "4", "id": "6e178989-7d8e-3c33-9628-50bdda7c4483", "track_or_recording_length": "173627"}], "disc-count": 1}]}}

0 comments on commit c963b01

Please sign in to comment.