eonpatapon / mpDris2

MPRIS V2.1 support for mpd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

broken /usr/bin/mpDris2

DolphinStKom opened this issue · comments

when i try to start mpDris2
mpDris2 2017-10-07 01:00:34,567 mpDris2 INFO: Using file:///home/dolphin/Music as music library path. 2017-10-07 01:00:34,568 mpDris2 INFO: Using Mutagen to read covers from music files. 2017-10-07 01:00:34,569 mpd INFO: Calling MPD connect('localhost', '6600', timeout=None) Traceback (most recent call last): File "/usr/bin/mpDris2", line 1388, in <module> mpd_wrapper.run() File "/usr/bin/mpDris2", line 290, in run if self.my_connect(): File "/usr/bin/mpDris2", line 365, in my_connect self.timer_callback() File "/usr/bin/mpDris2", line 453, in timer_callback self._update_properties(force=False) File "/usr/bin/mpDris2", line 752, in _update_properties self.update_metadata() File "/usr/bin/mpDris2", line 578, in update_metadata cover = self.find_cover(song_url) File "/usr/bin/mpDris2", line 640, in find_cover if tag.startswith("APIC:"): AttributeError: 'tuple' object has no attribute 'startswith'
Gentoo, Python 3.4.6 as default, mpd 0.20.10

What version of python-mutagen are you using?

media-libs/mutagen 1.38 (-doc -test PYTHON_TARGETS="python2_7 python3_4 -python3_5 -python3_6")

Hmm, that's odd

Do you know what file type it's crashing on? (Is it MP3, Ogg, MP4, ...?)

Can you try this patch:

diff --git a/src/mpDris2.in.py b/src/mpDris2.in.py
index d11a18f..2f2f03d 100755
--- a/src/mpDris2.in.py
+++ b/src/mpDris2.in.py
@@ -636,7 +636,7 @@ class MPDWrapper(object):
             if mutagen and os.path.exists(song_path):
                 song = mutagen.File(song_path)
 
-                for tag in song.tags:
+                for tag in song.tags.keys():
                     if tag.startswith("APIC:"):
                         for pic in song.tags.getall(tag):
                             if pic.type == mutagen.id3.PictureType.COVER_FRONT:

Yes, of course, I can =)
it fixed the work, thank You so much!!!