Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicfit committed Mar 4, 2020
1 parent b8d4bd0 commit 48cec17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
14 changes: 2 additions & 12 deletions eyed3/id3/tag.py
Expand Up @@ -28,16 +28,6 @@ class TagException(Error):
ID3_V1_MAX_TEXTLEN = 30
DEFAULT_PADDING = 256

"""dates2020
v2.3 v2.4 eyeD3
==== ==== ======
TORY TDOR original_release_date
TDRL release_date
TYER+ TDRC recording_date
TDAT+
TIME
"""


class Tag(core.Tag):
def __init__(self, **kwargs):
Expand Down Expand Up @@ -483,13 +473,13 @@ def getBestDate(self, prefer_recording_date=False):

def _getReleaseDate(self):
if self.version == ID3_V2_3:
return None
return self._getV23OrignalReleaseDate()
else:
return self._getDate(b"TDRL")

def _setReleaseDate(self, date):
if self.version == ID3_V2_3:
raise ValueError("Release date not supported in ID3 v2.3; see original release date.")
self._setDate(b"TORY", date)
else:
self._setDate(b"TDRL", date)

Expand Down
2 changes: 1 addition & 1 deletion eyed3/plugins/classic.py
Expand Up @@ -862,7 +862,7 @@ def _checkNumberedArgTuples(curr, new):
if self.args.release_year is not None:
# empty string means clean, None means not given
year = self.args.release_year
printWarning("Setting release year: %s" % year)
printWarning(f"Setting release year: {year}")
tag.release_date = int(year) if year else None
retval = True

Expand Down
4 changes: 2 additions & 2 deletions test/test_classic_plugin.py
Expand Up @@ -86,8 +86,8 @@ def testNewTagArtist(self, version=id3.ID3_DEFAULT_VERSION):
assert retval == 0

af = eyed3.load(self.test_file)
assert af is not None
assert af.tag is not None
assert af is not None
assert af.tag is not None
assert af.tag.artist == "The Cramps"

def testNewTagComposer(self, version=id3.ID3_DEFAULT_VERSION):
Expand Down

0 comments on commit 48cec17

Please sign in to comment.