diff options
author | jerous <jerous@gmail.com> | 2008-09-17 01:15:16 +0200 |
---|---|---|
committer | jerous <jerous@gmail.com> | 2008-09-17 01:15:16 +0200 |
commit | 5bc59c518834fcb99d582a439d4f15824708eaa6 (patch) | |
tree | 8493f0f29a45dc21977cd7e341af6f1415a93880 /plugins | |
parent | 79f4fcaa791e715976872961e0be438623b3f8ea (diff) |
Scrobbler: relogin when session timed out
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Scrobbler.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/Scrobbler.py b/plugins/Scrobbler.py index 94c0c89..7cb5b89 100644 --- a/plugins/Scrobbler.py +++ b/plugins/Scrobbler.py @@ -35,11 +35,18 @@ class pluginScrobbler(Plugin): if int(params['newTime'])>int(song.getTag('time'))/2 \ or int(params['newTime'])>240: log.normal("Scrobbler: submitting song") - submit(song.getArtist(), song.getTitle(), self.time, 'P', '', song.getTag('time'), song.getAlbum(), song.getTrack()) + submit(song.getArtist(), song.getTitle(), self.time, 'P', '', song.getTag('time'), song.getAlbum(), song.getTrack(), False) log.debug("Scrobbler: flushing ...") try: flush() self.submitted=True + except SessionError, e: + log.important("Scrobbler: failed to sumit song - %s"%(e)) + log.extended("Logging in ...") + self._login() + try: + flush() + self.submitted=True except Exception, e: log.important("Scrobbler: failed to sumit song - %s"%(e)) log.debug("Scrobbler: flushed") |