From 0de22eb9e1629a758314b4aafb0f2259a4ecb8b9 Mon Sep 17 00:00:00 2001 From: icedream Date: Wed, 21 Oct 2015 20:58:36 +0200 Subject: [PATCH] Trim parameters so whitespace doesn't invalidate URLs. --- app.iced | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app.iced b/app.iced index fc5f057..02782f8 100644 --- a/app.iced +++ b/app.iced @@ -149,14 +149,13 @@ ts3clientService.on "started", (ts3proc) => return when "play" inputBB = paramline.trim() + input = (removeBB paramline).trim() # we gonna interpret play without a url as an attempt to unpause the current song - if inputBB.length <= 0 + if input.length <= 0 vlc.status.resume() return - input = removeBB inputBB - # only allow playback from file if it's a preconfigured alias if isValidUrl input log.debug "Got input URL:", input @@ -209,14 +208,13 @@ ts3clientService.on "started", (ts3proc) => ts3query.sendtextmessage args.targetmode, invoker.id, "Playing next song in the playlist." when "enqueue", "add", "append" - inputBB = paramline + inputBB = paramline.trim() + input = (removeBB paramline).trim() if inputBB.length <= 0 ts3query.sendtextmessage args.targetmode, invoker.id, "[B]#{name} [/B] - Adds the specified URL to the current playlist" return - input = removeBB paramline - # only allow playback from file if it's a preconfigured alias if isValidUrl input log.debug "Got input URL:", input