Trim parameters so whitespace doesn't invalidate URLs.

develop
Icedream 2015-10-21 20:58:36 +02:00
parent 207bf24663
commit 0de22eb9e1
1 changed files with 4 additions and 6 deletions

View File

@ -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} <url>[/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