From 1cb66900a1ee54d71d26bf85d10fab4a70c94cfc Mon Sep 17 00:00:00 2001 From: Sophist Date: Wed, 14 Oct 2015 19:02:35 +0100 Subject: [PATCH 1/4] Add support for id3 TKEY ... ... in support of an AcousticBrainz plugin which will set the TKEY ID3 tag. --- picard/formats/id3.py | 3 ++- picard/util/tags.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/picard/formats/id3.py b/picard/formats/id3.py index 5fdb72386..9aaa4eaac 100644 --- a/picard/formats/id3.py +++ b/picard/formats/id3.py @@ -129,6 +129,7 @@ class ID3File(File): 'TCOM': 'composer', 'TENC': 'encodedby', 'TBPM': 'bpm', + 'TKEY': 'key', 'TLAN': 'language', 'TCON': 'genre', 'TMED': 'media', @@ -438,7 +439,7 @@ class ID3File(File): v1 = 2 else: v1 = 0 - + if config.setting['write_id3v23']: tags.update_to_v23(join_with=config.setting['id3v23_join_with']) tags.save(filename, v2_version=3, v1=v1) diff --git a/picard/util/tags.py b/picard/util/tags.py index acc4ac78a..996ccfbef 100644 --- a/picard/util/tags.py +++ b/picard/util/tags.py @@ -39,6 +39,7 @@ TAG_NAMES = { 'isrc': N_('ISRC'), 'mood': N_('Mood'), 'bpm': N_('BPM'), + 'key': N_('Key'), 'copyright': N_('Copyright'), 'license': N_('License'), 'composer': N_('Composer'), From d41b64d825b86e65056324256efd4488f827a3d3 Mon Sep 17 00:00:00 2001 From: Sophist Date: Wed, 14 Oct 2015 19:21:25 +0100 Subject: [PATCH 2/4] Add next API version... ... for plugins which require functionality which will only be in 1.4.0 --- picard/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/picard/__init__.py b/picard/__init__.py index 75d612886..e34266128 100644 --- a/picard/__init__.py +++ b/picard/__init__.py @@ -91,4 +91,5 @@ api_versions = [ "1.1.0", "1.2.0", "1.3.0", + "1.4.0", ] From 07b8f71a273fb873ac2287068e9522d01c5acf7a Mon Sep 17 00:00:00 2001 From: Sophist Date: Wed, 14 Oct 2015 21:40:49 +0100 Subject: [PATCH 3/4] Add support for mp4 and asf formats. --- picard/formats/asf.py | 1 + picard/formats/mp4.py | 1 + 2 files changed, 2 insertions(+) diff --git a/picard/formats/asf.py b/picard/formats/asf.py index 7125cbcf2..e452ecc61 100644 --- a/picard/formats/asf.py +++ b/picard/formats/asf.py @@ -97,6 +97,7 @@ class ASFFile(File): 'comment:': 'Description', 'genre': 'WM/Genre', 'bpm': 'WM/BeatsPerMinute', + 'key': 'WM/InitialKey', 'script': 'WM/Script', 'language': 'WM/Language', 'mood': 'WM/Mood', diff --git a/picard/formats/mp4.py b/picard/formats/mp4.py index 67b5171d6..7fe09c9bb 100644 --- a/picard/formats/mp4.py +++ b/picard/formats/mp4.py @@ -102,6 +102,7 @@ class MP4File(File): "----:com.apple.iTunes:LANGUAGE": "language", "----:com.apple.iTunes:ARTISTS": "artists", "----:com.apple.iTunes:WORK": "work", + "----:com.apple.iTunes:initialkey": "key", } __r_freeform_tags = dict([(v, k) for k, v in __freeform_tags.iteritems()]) From 2d932e3bba64b8d6dd31ec8a4062f752db6bea4e Mon Sep 17 00:00:00 2001 From: Sophist Date: Thu, 15 Oct 2015 10:51:20 +0100 Subject: [PATCH 4/4] Add support for automated tests. --- test/test_formats.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_formats.py b/test/test_formats.py index f72db8256..2ff56b3e6 100644 --- a/test/test_formats.py +++ b/test/test_formats.py @@ -137,6 +137,7 @@ class FLACTest(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -206,6 +207,7 @@ class WMATest(FormatsTest): #'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -275,6 +277,7 @@ class MP3Test(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -342,6 +345,7 @@ class TTATest(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -410,6 +414,7 @@ if picard.formats.AiffFile: 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -477,6 +482,7 @@ class OggVorbisTest(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -545,6 +551,7 @@ class MP4Test(FormatsTest): #'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -612,6 +619,7 @@ class WavPackTest(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -679,6 +687,7 @@ class MusepackSV7Test(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo', @@ -746,6 +755,7 @@ class MusepackSV8Test(FormatsTest): 'comment:foo': 'Foo', 'genre': 'Foo', 'bpm': '80', + 'key': 'E#m', 'mood': 'Foo', 'isrc': 'Foo', 'copyright': 'Foo',