Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpDris2 crashes if mutagen can't read the file #127

Closed
Azenet opened this issue Jan 15, 2020 · 3 comments
Closed

mpDris2 crashes if mutagen can't read the file #127

Azenet opened this issue Jan 15, 2020 · 3 comments

Comments

@Azenet
Copy link

Azenet commented Jan 15, 2020

Hi,

mpDris2 crashes if mutagen is present but cannot read the file and does not throw a MutagenError exception:

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 1480, in <module>
    mpd_wrapper.run()
  File "/usr/bin/mpDris2", line 291, in run
    if self.my_connect():
  File "/usr/bin/mpDris2", line 366, in my_connect
    self.timer_callback()
  File "/usr/bin/mpDris2", line 454, in timer_callback
    self._update_properties(force=False)
  File "/usr/bin/mpDris2", line 758, in _update_properties
    self.update_metadata()
  File "/usr/bin/mpDris2", line 580, in update_metadata
    cover = self.find_cover(song_url)
  File "/usr/bin/mpDris2", line 643, in find_cover
    if song.tags:
AttributeError: 'NoneType' object has no attribute 'tags'

#107 is similar but the fix in e3bdb9e only catches explicit mutagen errors, I assume. I'm using mutagen 1.43.0.

@grawity
Copy link
Collaborator

grawity commented Jan 15, 2020

Sigh, I thought mutagen.File was a class constructor but it's a function?

grawity added a commit that referenced this issue Jan 15, 2020
Tag extraction failure should just fall back to loading standalone cover
files instead of failing completely.

Also, apparently mutagen.File() is a function and can return None if the
provided file type is completely unrecognized. This should make the
function handle both situations in the same way.

Ref: #127
@grawity
Copy link
Collaborator

grawity commented Jan 15, 2020

Please test master.

@Azenet
Copy link
Author

Azenet commented Jan 15, 2020

It works, thank you.

@Azenet Azenet closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants