From 32b3cac1709c63eb30ffb19ad81faf3159db68ad Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 26 Dec 2009 16:23:58 +0100 Subject: [PATCH] Reduce amount of end-of-track crashes by adding a call to next() when at end of track. Only works when a client is connected as it is called by the 'status' command. --- mopidy/backends/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mopidy/backends/base.py b/mopidy/backends/base.py index 7e3040e8..dba972a2 100644 --- a/mopidy/backends/base.py +++ b/mopidy/backends/base.py @@ -84,6 +84,10 @@ class BaseBackend(object): return self.state def status_time(self): + # XXX This is only called when a client is connected, and is thus not a + # complete solution + if self._play_time_elapsed >= self.status_time_total() > 0: + self.end_of_track() return u'%s:%s' % (self._play_time_elapsed, self.status_time_total()) def status_time_total(self): @@ -94,6 +98,9 @@ class BaseBackend(object): # Control methods + def end_of_track(self): + self.next() + def next(self): self.stop() if self._next():