From c3f9fbc1544babb5662ba396132000dbc08afe9d Mon Sep 17 00:00:00 2001 From: Sophist Date: Tue, 26 Nov 2013 18:12:42 +0000 Subject: [PATCH 1/4] Set compilation based only on VA --- picard/album.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/picard/album.py b/picard/album.py index 06f9c7e62..806a3e5cc 100644 --- a/picard/album.py +++ b/picard/album.py @@ -188,7 +188,6 @@ class Album(DataObject, Item): return if not self._tracks_loaded: - artists = set() totalalbumtracks = 0 djmix_ars = {} @@ -215,7 +214,6 @@ class Album(DataObject, Item): track._customize_metadata() self._new_metadata.length += tm.length - artists.add(tm["musicbrainz_artistid"]) # Run track metadata plugins try: @@ -227,7 +225,7 @@ class Album(DataObject, Item): for track in self._new_tracks: track.metadata["~totalalbumtracks"] = totalalbumtracks - if len(artists) > 1: + if self.metadata['musicbrainz_albumartistid'] == VARIOUS_ARTISTS_ID: track.metadata["compilation"] = "1" del self._release_node From a0d8ac0726271f5c0006a4ca15d9984452423772 Mon Sep 17 00:00:00 2001 From: Sophist Date: Tue, 26 Nov 2013 18:53:56 +0000 Subject: [PATCH 2/4] Rename compilations tag --- picard/util/tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picard/util/tags.py b/picard/util/tags.py index e4e4dc775..3d341fd32 100644 --- a/picard/util/tags.py +++ b/picard/util/tags.py @@ -65,7 +65,7 @@ TAG_NAMES = { 'acoustid_fingerprint': N_('AcoustID Fingerprint'), 'discid': N_('Disc Id'), 'website': N_('Website'), - 'compilation': N_('Compilation'), + 'compilation': N_('Compilation (iTunes)'), 'comment:': N_('Comment'), 'genre': N_('Genre'), 'encodedby': N_('Encoded By'), From 4afed13ba8c03d619997c62a6bbf50574e552f3f Mon Sep 17 00:00:00 2001 From: Sophist Date: Tue, 26 Nov 2013 19:11:25 +0000 Subject: [PATCH 3/4] Add NEWS.txt update. --- NEWS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.txt b/NEWS.txt index db0a829c4..bc3c3d840 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -11,6 +11,7 @@ * Fix Options / File naming examples to handle primary/secondary release types (PICARD-516) * A new advanced option is available to permanently set the starting directory for the file browser and "Add files/folder" buttons. + * Compilation tag/variable aligned with iTunes, set only for Various Artists type compilations. Version 1.2 - 2013-03-30 * Picard now requires at least Python 2.6 From 85f455a176a156a278c9ba2e5198268c06a8ec8e Mon Sep 17 00:00:00 2001 From: Sophist Date: Sat, 30 Nov 2013 14:59:55 +0000 Subject: [PATCH 4/4] Address Michael's comment --- picard/album.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/picard/album.py b/picard/album.py index 806a3e5cc..6c977f50d 100644 --- a/picard/album.py +++ b/picard/album.py @@ -189,6 +189,7 @@ class Album(DataObject, Item): if not self._tracks_loaded: totalalbumtracks = 0 + va = self._new_metadata['musicbrainz_albumartistid'] == VARIOUS_ARTISTS_ID djmix_ars = {} if hasattr(self._new_metadata, "_djmix_ars"): @@ -214,6 +215,8 @@ class Album(DataObject, Item): track._customize_metadata() self._new_metadata.length += tm.length + if va: + tm["compilation"] = "1" # Run track metadata plugins try: @@ -225,8 +228,6 @@ class Album(DataObject, Item): for track in self._new_tracks: track.metadata["~totalalbumtracks"] = totalalbumtracks - if self.metadata['musicbrainz_albumartistid'] == VARIOUS_ARTISTS_ID: - track.metadata["compilation"] = "1" del self._release_node self._tracks_loaded = True