Listen unusable after connection to last.fm failed

Bug #502617 reported by Brian Amberg
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Listen
New
Undecided
Unassigned

Bug Description

I tried to connect to a last.fm station. Listen said: "Connected, Station found" but did not play any music.
Now I was unable to change to a different track, because the change operation tried to delete the "#stream_offset" key. Here is the traceback:

Traceback (most recent call last):
  File "/usr/lib/listen/widget/playlist.py", line 221, in on_activated
    self.play_selected()
  File "/usr/lib/listen/widget/playlist.py", line 225, in play_selected
    Player.play_new(model[rows[0]][0])
  File "/usr/lib/listen/player/__init__.py", line 243, in play_new
    self.set_song(song, True, crossfade, seek)
  File "/usr/lib/listen/player/__init__.py", line 261, in set_song
    LastFmPlayer.stop()
  File "/usr/lib/listen/lastfm_player.py", line 262, in stop
    ListenDB.del_property(self.song,["#stream_offset","album","artist","track_url","#duration","title"])
  File "/usr/lib/listen/library.py", line 499, in del_property
    for key in keys: del song[key]
KeyError: '#stream_offset'

I patched the file

/usr/lib/listen/library.py

to

 493 def del_property(self, song, keys):
 494 if not song: return False
 495 self._dirty = True
 496 type = song.get_type()
 497 old_keys_values = {}
 498 [ old_keys_values.update({key:song.get_sortable(key)}) for key in song.keys() if key in keys]
 499 for key in keys:
 500 if key in song.keys():
 501 del song[key]
 502 song.sanitarize()
 503 self.__condition.acquire()
 504 self.__queued_signal["changed"].setdefault(type, [])
 505 self.__queued_signal["changed"][type].append((song, old_keys_values))
 506 self.__condition.release()

and now I can change the songs again, but last.fm still is not working.

best regards,

Brian

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.