Quick fix for the no-metadata crash, closes #23.

develop
Icedream 2015-11-02 16:06:34 +01:00
parent b1cc9f6255
commit 2ee4dc32c3
1 changed files with 2 additions and 1 deletions

View File

@ -72,8 +72,9 @@ ts3clientService.on "started", (ts3proc) =>
# VLC event handling
vlc.onPlaying = () =>
# TODO: Check why info is sometimes null, something must be wrong with the "add"/"play" commands here!
info = vlcMediaInfo[vlc.playlist.items[vlc.playlist.currentItem].mrl]
ts3query.sendtextmessage 2, 0, "Now playing [URL=#{info.originalUrl}]#{info.title}[/URL]."
ts3query.sendtextmessage 2, 0, "Now playing [URL=#{info?.originalUrl or vlc.playlist.items[vlc.playlist.currentItem].mrl}]#{info?.title or vlc.playlist.items[vlc.playlist.currentItem].mrl}[/URL]."
vlc.onPaused = () => ts3query.sendtextmessage 2, 0, "Paused."
vlc.onForward = () => ts3query.sendtextmessage 2, 0, "Fast-forwarding..."
vlc.onBackward = () => ts3query.sendtextmessage 2, 0, "Rewinding..."