Fixed skipping songs

This commit is contained in:
Matthieu Grieger 2014-09-23 08:52:04 -07:00
parent 48e4eea70a
commit 0a50778618
2 changed files with 4 additions and 0 deletions

View file

@ -173,6 +173,7 @@ function skip(username)
local skip_ratio = song_queue:count_skippers() / count_users()
if skip_ratio > config.SKIP_RATIO then
piepan.me.channel:send(config.SONG_SKIPPED_HTML)
piepan.Audio:stop()
next_song()
else
piepan.me.channel:send(string.format(config.USER_SKIP_HTML, username))

View file

@ -98,6 +98,9 @@ function start_song(info)
os.execute("sleep " .. tonumber(2))
end
if not file_exists(".video_fail") then
if piepan.Audio:isPlaying() then
piepan.Audio:stop()
end
piepan.me.channel:play("song-converted.ogg", SongQueue.get_next_song)
else
return false