Commits

Travis Shirk committed ea0a2c1

Some more date fixes and undoings

Comments (0)

Files changed (2)

src/eyed3/id3/tag.py

                 self.recording_date)
 
     def _getReleaseDate(self):
-        return self._getDate("TDRL" if self.version == ID3_V2_4 else "TORY")
+        return self._getDate("TDRL") if self.version == ID3_V2_4\
+                                     else self._getV23OrignalReleaseDate()
     def _setReleaseDate(self, date):
         self._setDate("TDRL" if self.version == ID3_V2_4 else "TORY", date)
 
             self.frame_set[fid] = frames.DateFrame(fid, date_text)
 
     def _getDate(self, fid):
+        if fid in ("TORY", "XDOR"):
+            return self._getV23OrignalReleaseDate()
+
         if fid in self.frame_set:
-            try:
-                if fid in ("TYER", "TDAT", "TIME", "TORY"):
-                    if fid in ("TYER", "TORY"):
-                        # Contain years only, date conversion can happen
-                        return core.Date(int(self.frame_set[fid][0].text))
-                    else:
-                        return self.frame_set[fid][0].text
+            if fid in ("TYER", "TDAT", "TIME"):
+                if fid == "TYER":
+                    # Contain years only, date conversion can happen
+                    return core.Date(int(self.frame_set[fid][0].text))
                 else:
-                    return self.frame_set[fid][0].date
-            except ValueError as ex:
-                # Invalid date
-                raise TagException(ex)
+                    return self.frame_set[fid][0].text
+            else:
+                return self.frame_set[fid][0].date
         else:
             return None
 

src/eyed3/plugins/classic.py

                 printWarning("Renamed '%s' to '%s'" % (orig,
                                                        self.audio_file.path))
             printMsg("-" * 79)
-        except id3.tag.TagException as ex:
-            printError("Error: %s" % ex)
         except exceptions.Exception as ex:
             log.error(traceback.format_exc())
             if self.args.debug_pdb:
             printMsg("%s: %s" % (boldText("artist"), artist))
             printMsg("%s: %s" % (boldText("album"), album))
 
-            try:
-                for date, date_label in [
-                        (tag.release_date, "release date"),
-                        (tag.original_release_date, "original release date"),
-                        (tag.recording_date, "recording date"),
-                        (tag.encoding_date, "encoding date"),
-                        (tag.tagging_date, "tagging date"),
-                        ]:
-                    if date:
-                        printMsg("%s: %s" % (boldText(date_label), str(date)))
-            except id3.TagException as ex:
-                printError(str(ex))
+            for date, date_label in [
+                    (tag.release_date, "release date"),
+                    (tag.original_release_date, "original release date"),
+                    (tag.recording_date, "recording date"),
+                    (tag.encoding_date, "encoding date"),
+                    (tag.tagging_date, "tagging date"),
+                    ]:
+                if date:
+                    printMsg("%s: %s" % (boldText(date_label), str(date)))
 
             track_str = ""
             (track_num, track_total) = tag.track_num