Skip to content

Commit

Permalink
Catch Mutagen exceptions for malformed files
Browse files Browse the repository at this point in the history
Ref: #107
  • Loading branch information
grawity committed Nov 7, 2018
1 parent dcf0216 commit e3bdb9e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mpDris2.in.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,11 @@ def update_metadata(self):
if not any([song_url.startswith(prefix) for prefix in urlhandlers]):
song_url = os.path.join(self._params['music_dir'], song_url)
self._metadata['xesam:url'] = song_url
cover = self.find_cover(song_url)
try:
cover = self.find_cover(song_url)
except mutagen.MutagenError as e:
logger.error("Can't extract covers from %r: %r" % (song_url, e))
cover = None
if cover:
self._metadata['mpris:artUrl'] = cover

Expand Down

0 comments on commit e3bdb9e

Please sign in to comment.