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 commands here
echo -n "Restarting Liquidsoap: "
stop-liquidsoap
start-liquidsoap
liquidsoap_stop
liquidsoap_start
echo "Done."
;;
'pypo-stop')

View File

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