From 4d25c2b822d1660546a48b89db34645285408dd7 Mon Sep 17 00:00:00 2001 From: icedream Date: Wed, 28 Oct 2015 00:16:10 +0100 Subject: [PATCH] Small fixes for empty playlists. --- app.iced | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.iced b/app.iced index cf5006f..e71ef00 100644 --- a/app.iced +++ b/app.iced @@ -227,11 +227,17 @@ ts3clientService.on "started", (ts3proc) => ts3query.sendtextmessage args.targetmode, invoker.id, "[B]#{name} on|off[/B] - Turns playlist looping on or off" return when "next" + if vlc.playlist.items.count == 0 + ts3query.sendtextmessage args.targetmode, invoker.id, "The playlist is empty." + return if vlc.playlist.mode != vlc.playlist.Loop and vlc.playlist.currentItem == vlc.playlist.items.count - 1 ts3query.sendtextmessage args.targetmode, invoker.id, "Can't jump to next playlist item, this is the last one!" return vlc.playlist.next() when "prev", "previous" + if vlc.playlist.items.count == 0 + ts3query.sendtextmessage args.targetmode, invoker.id, "The playlist is empty." + return if vlc.playlist.mode != vlc.playlist.Loop and vlc.playlist.currentItem <= 0 ts3query.sendtextmessage args.targetmode, invoker.id, "Can't jump to previous playlist item, this is the first one!" return