CC-3840: Deleting current playing item sometimes results in random next track playing

-possibly fixed
This commit is contained in:
Martin Konecny 2012-05-17 16:30:40 -04:00
parent f53a9c1811
commit b2c63544a9
2 changed files with 20 additions and 23 deletions

View File

@ -130,8 +130,8 @@ case "${1:-''}" in
'restart-liquidsoap') 'restart-liquidsoap')
# restart commands here # restart commands here
echo -n "Restarting Liquidsoap: " echo -n "Restarting Liquidsoap: "
stop-liquidsoap liquidsoap_stop
start-liquidsoap liquidsoap_start
echo "Done." echo "Done."
;; ;;
'pypo-stop') 'pypo-stop')

View File

@ -345,10 +345,12 @@ class PypoPush(Thread):
self.telnet_lock.acquire() self.telnet_lock.acquire()
tn = telnetlib.Telnet(LS_HOST, LS_PORT) tn = telnetlib.Telnet(LS_HOST, LS_PORT)
# If the current playing item is to be removed, let's remove it last if problem_at_iteration == 0:
# otherwise if we remove it first, the item after it that we also intend msg = "source.skip\n"
# to remove will quickly slide into the current playing position. This seems self.logger.debug(msg)
# to confuse Liquidsoap. tn.write(msg)
else:
# Remove things in reverse order.
queue_copy = liquidsoap_queue_approx[::-1] queue_copy = liquidsoap_queue_approx[::-1]
for queue_item in queue_copy: for queue_item in queue_copy:
@ -366,11 +368,6 @@ class PypoPush(Thread):
self.logger.debug(msg) self.logger.debug(msg)
tn.write(msg) tn.write(msg)
if problem_at_iteration == 0:
msg = "source.skip\n"
self.logger.debug(msg)
tn.write(msg)
msg = "queue.queue\n" msg = "queue.queue\n"
self.logger.debug(msg) self.logger.debug(msg)
tn.write(msg) tn.write(msg)