From: Simeon Veldstra Date: Tue, 12 Jun 2007 06:13:26 +0000 (-0700) Subject: Merge with bugfix-0.5 0.5.12 X-Git-Tag: v0.5.13 X-Git-Url: http://puddle.ca/cgi-bin/gitweb.cgi?p=mp3togo;a=commitdiff;h=0d0f879136da4c77156cd6d8ca6441d9173079d0 Merge with bugfix-0.5 0.5.12 --- --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mp3togo (0.5.12) unstable; urgency=low + + * Fixed eyeD3 to work without ID3 present. + Bug reported by Konsantin Pastbin. + Added --no-guessing-tags option. + + -- Simeon Veldstra Mon, 11 Jun 2007 19:48:03 -0700 + mp3togo (0.5.11) unstable; urgency=low * Fixed ommited year and tracknumber tags on mp3 conversions using eyeD3. --- a/debian/mp3togo.1 +++ b/debian/mp3togo.1 @@ -134,4 +134,4 @@ License can be found in /usr/share/commo .PP mp3togo can be found online at http://puddle.ca/mp3togo -.\" created by instant / docbook-to-man, Sat 09 Jun 2007, 20:36 +.\" created by instant / docbook-to-man, Mon 11 Jun 2007, 19:51 --- a/mp3togo/conf.py +++ b/mp3togo/conf.py @@ -93,6 +93,8 @@ class Options(options.Options): '''A string specifying the format for the output files. The format string can contain the following escapes:
  • %a - Artist
  • %l - Album
  • %t - Title
  • %y - Year
  • %g - Genre
  • %% - Literal '%'
    Overrides --tree-depth.'''), ('notags', '', 'no-tags', False, None, '''Do not try to write tags to the output files.'''), + ('noguesstags', '', 'no-guessing-tags', False, None, + '''Do not attempt to guess missing tags from the file name.'''), ('maxunits', 'm', 'max-size', '0', self._units, '''The disk space available to use in bytes. Append 'M' for megabytes, 'G' for gigabytes or 'K' for kilobytes. Use 0 to use all available space on the filesystem.'''), ('maxsize', '', '', 0L, None, ''), --- a/mp3togo/tags.py +++ b/mp3togo/tags.py @@ -94,7 +94,7 @@ class Tags(UserDict.DictMixin): o['GENRE'] = 'Other' return o - if self._type == 'mp3' and HAVE_ID3: + if self._type == 'mp3': rok = False if HAVE_eyeD3: eye = eyeD3.Tag() @@ -112,10 +112,9 @@ class Tags(UserDict.DictMixin): except eyeD3.tag.GenreException: self._tags['GENRE'] = 'Other' del eye - rok = True except eyeD3.tag.TagException: pass - if HAVE_ID3 and not rok: + elif HAVE_ID3: info = ID3.ID3(self._file, as_tuple=1).as_dict() self._tags = copytags(info) del info @@ -141,10 +140,15 @@ class Tags(UserDict.DictMixin): path = path.replace('_', ' ') for id, depth in [('ARTIST', -3), ('ALBUM', -2), ('TITLE', -1)]: if not id in self._tags or self._tags[id][0] == '': - try: - self._tags[id] = [path.split(os.sep)[depth]] - except IndexError: - self._tags[id] = "%s unknown" % id.lower() + if self._opts['noguesstags']: + self._tags[id] = [''] + else: + try: + self._tags[id] = [path.split(os.sep)[depth]] + self._opts.log(1, "Missing %s tag, guessing %s from file name." % + (id, self._tags[id][0])) + except IndexError: + self._tags[id] = "%s unknown" % id.lower() self._readok.set() self._lock.release()