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:
parent
e47d7491eb
commit
32b3cac170
@ -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():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user