From 835fa46c85b5d84a527e17dc7afde3e0939f392b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Wei=C3=9Fl?= Date: Thu, 21 Jun 2012 03:20:46 +0200 Subject: [PATCH] Store lyrics language in tags instead of text representation language (PICARD-242) This changes the meaning of the "language" tag. It is now no longer derived from the text representation language of the release, but from the lyrics language of the linked work(s). The text representation language of the release is still available (e.g. for scripting/plugins) as %_releaselanguage%. To get the old behavior back, one must insert this line at the beginning of the scripting field: $set(language,%_releaselanguage%) http://tickets.musicbrainz.org/browse/PICARD-242 --- NEWS.txt | 1 + picard/mbxml.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.txt b/NEWS.txt index 481f19827..4b0dbfbe3 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -8,6 +8,7 @@ Version 1.0.1 - unreleased * Refreshing a non-album track correctly clears previous track metadata (PICARD-220) * Fixed the preserved tags setting for tags with uppercase characters (PICARD-217) * Added a completion box to the preserved tags setting, and clarified how it works + * Store lyrics language in tags instead of text representation language (PICARD-242) Version 1.0 - 2012-06-02 * New UI: Extended comparison of existing vs. MB metadata & tags (PICARD-43) diff --git a/picard/mbxml.py b/picard/mbxml.py index aafc99bd6..2dbe5caeb 100644 --- a/picard/mbxml.py +++ b/picard/mbxml.py @@ -251,6 +251,8 @@ def recording_to_metadata(node, track, config): def work_to_metadata(work, m, config): m.add("musicbrainz_workid", work.attribs['id']) + if 'language' in work.children: + m.add("language", work.language[0].text) if 'relation_list' in work.children: _relations_to_metadata(work.relation_list, m, config) @@ -298,7 +300,7 @@ def release_to_metadata(node, m, config, album=None): m['label'], m['catalognumber'] = label_info_from_node(nodes[0]) elif name == 'text_representation': if 'language' in nodes[0].children: - m['language'] = nodes[0].language[0].text + m['~releaselanguage'] = nodes[0].language[0].text if 'script' in nodes[0].children: m['script'] = nodes[0].script[0].text elif name == 'tag_list':