mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-24 00:26:08 +00:00
add 'license' tag, id3: WCOP
This commit is contained in:
@@ -88,6 +88,7 @@ class ID3File(File):
|
||||
'TMED': 'media',
|
||||
'TBPM': 'bpm',
|
||||
'WOAR': 'website',
|
||||
'WCOP': 'license',
|
||||
'TSRC': 'isrc',
|
||||
'TENC': 'encodedby',
|
||||
'TCOP': 'copyright',
|
||||
@@ -114,6 +115,7 @@ class ID3File(File):
|
||||
'Acoustid Fingerprint': 'acoustid_fingerprint',
|
||||
'Acoustid Id': 'acoustid_id',
|
||||
'SCRIPT': 'script',
|
||||
'LICENSE': 'license',
|
||||
'ALBUMARTISTSORT': 'albumartistsort',
|
||||
'CATALOGNUMBER': 'catalognumber',
|
||||
'BARCODE': 'barcode',
|
||||
@@ -284,7 +286,11 @@ class ID3File(File):
|
||||
elif name in self.__rtranslate:
|
||||
frameid = self.__rtranslate[name]
|
||||
if frameid.startswith('W'):
|
||||
tags.add(getattr(id3, frameid)(url=values[0]))
|
||||
# Only add WCOP if there is only one license, otherwise use TXXX:LICENSE
|
||||
if frameid == 'WCOP' and len(values) > 1:
|
||||
tags.add(id3.TXXX(encoding=encoding, desc=self.__rtranslate_freetext[name], text=values))
|
||||
else:
|
||||
tags.add(getattr(id3, frameid)(url=values[0]))
|
||||
elif frameid.startswith('T'):
|
||||
tags.add(getattr(id3, frameid)(encoding=encoding, text=values))
|
||||
elif name in self.__rtranslate_freetext:
|
||||
|
||||
@@ -89,6 +89,7 @@ class MP4File(File):
|
||||
"----:com.apple.iTunes:ISRC": "isrc",
|
||||
"----:com.apple.iTunes:MEDIA": "media",
|
||||
"----:com.apple.iTunes:LABEL": "label",
|
||||
"----:com.apple.iTunes:LICENSE": "license",
|
||||
"----:com.apple.iTunes:CATALOGNUMBER": "catalognumber",
|
||||
"----:com.apple.iTunes:SUBTITLE": "subtitle",
|
||||
"----:com.apple.iTunes:DISCSUBTITLE": "discsubtitle",
|
||||
|
||||
@@ -109,6 +109,9 @@ def _relations_to_metadata(relation_lists, m, config):
|
||||
match = AMAZON_ASIN_URL_REGEX.match(url)
|
||||
if match is not None and 'asin' not in m:
|
||||
m['asin'] = match.group(2)
|
||||
if relation.type == 'license':
|
||||
url = relation.target[0].text
|
||||
m.add('license', url)
|
||||
|
||||
|
||||
def _translate_artist_node(node, config=None):
|
||||
|
||||
@@ -39,6 +39,7 @@ tag_names = {
|
||||
'mood': N_('Mood'),
|
||||
'bpm': N_('BPM'),
|
||||
'copyright': N_('Copyright'),
|
||||
'license': N_('License'),
|
||||
'composer': N_('Composer'),
|
||||
'conductor': N_('Conductor'),
|
||||
'lyricist': N_('Lyricist'),
|
||||
|
||||
Reference in New Issue
Block a user