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.

This commit is contained in:
Stein Magnus Jodal 2009-12-26 16:23:58 +01:00
parent e47d7491eb
commit 32b3cac170

View File

@ -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():