jesseward / discogstagger

Console based audio-file metadata tagger that uses the Discogs.com API v2 (JSON based). Relies on the Mutagen and discogs-client libraries. Currently supports FLAC and MP3 file types.
MIT License
70 stars 13 forks source link

AttributeError: 'NoneType' object has no attribute 'group' #26

Closed dromer closed 7 years ago

dromer commented 8 years ago

Trying to tag 1704873 - https://www.discogs.com/Various-Pong/release/1704873 - https://archive.org/details/Va-Pong

Full output:

$ discogs_tagger.py -s Va-Pong -r 1704873 -d Va-Pong_tagged
INFO:__main__:destdir set to Va-Pong_tagged
INFO:__main__:Using destination directory: Va-Pong_tagged
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): api.discogs.com
INFO:discogstagger.discogsalbum:Fetching Various - Pong (1704873)
Traceback (most recent call last):
  File "/usr/local/bin/discogs_tagger.py", line 166, in <module>
    split_artists, split_genres_and_styles, copy_other_files, char_exceptions)
  File "/usr/local/lib/python2.7/dist-packages/discogstagger/taggerutils.py", line 64, in __init__
    self.tag_map = self._get_tag_map()
  File "/usr/local/lib/python2.7/dist-packages/discogstagger/taggerutils.py", line 178, in _get_tag_map
    track.tracknumber, position, fileext)
  File "/usr/local/lib/python2.7/dist-packages/discogstagger/taggerutils.py", line 105, in _value_from_tag
    format = self._value_from_tag_format(format, trackno, position, filetype)
  File "/usr/local/lib/python2.7/dist-packages/discogstagger/taggerutils.py", line 79, in _value_from_tag_format
    "%YEAR%": self.album.year,
  File "/usr/local/lib/python2.7/dist-packages/discogstagger/discogsalbum.py", line 130, in year
    return good_year.match(str(self.release.data["year"])).group(0)
AttributeError: 'NoneType' object has no attribute 'group'
jesseward commented 7 years ago

Looks like a bug in the way that null/empty discogs_client.release.data['year'] values were handled. I have fixed this locally and will commit this and a few other changes early this week

jesseward commented 7 years ago

Addressed in commit https://github.com/jesseward/discogstagger/commit/7cd13695d818fbc2b9f4cd2bee9de8e5442acff0