mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-24 00:26:08 +00:00
id3: only write WCOP frame for URLs, otherwise use TXXX:LICENSE
This commit is contained in:
@@ -25,6 +25,7 @@ from picard.metadata import Metadata
|
||||
from picard.file import File
|
||||
from picard.formats.mutagenext import compatid3
|
||||
from picard.util import encode_filename, sanitize_date
|
||||
from urlparse import urlparse
|
||||
|
||||
|
||||
# Ugly, but... I need to save the text in ISO-8859-1 even if it contains
|
||||
@@ -286,11 +287,11 @@ class ID3File(File):
|
||||
elif name in self.__rtranslate:
|
||||
frameid = self.__rtranslate[name]
|
||||
if frameid.startswith('W'):
|
||||
# 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:
|
||||
# Only add WCOP if there is only one license URL, otherwise use TXXX:LICENSE
|
||||
if frameid == 'WCOP' and len(values) == 1 and all(urlparse(values[0])[:2]):
|
||||
tags.add(getattr(id3, frameid)(url=values[0]))
|
||||
else:
|
||||
tags.add(id3.TXXX(encoding=encoding, desc=self.__rtranslate_freetext[name], text=values))
|
||||
elif frameid.startswith('T'):
|
||||
tags.add(getattr(id3, frameid)(encoding=encoding, text=values))
|
||||
elif name in self.__rtranslate_freetext:
|
||||
|
||||
Reference in New Issue
Block a user