We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
suena / fish
1
#!/usr/bin/env fish
2
3
source suena.credentials.fish
4
5
set title x
6
set artist x
7
set album x
8
set playbackRate 0
9
10
while true
11
set ntitle (./nowplaying-cli get title)
12
set nartist (./nowplaying-cli get artist)
13
set nalbum (./nowplaying-cli get album)
14
set nplaybackRate (./nowplaying-cli get playbackRate)
15
16
if test "$ntitle" != "$title" -o "$nartist" != "$artist" -o "$nalbum" != "$album" -o "$nplaybackRate" != "$playbackRate"
17
set title "$ntitle"
18
set artist "$nartist"
19
set album "$nalbum"
20
set playbackRate "$nplaybackRate"
21
22
if test "$playbackRate" -eq 1
23
curl -v -XPOST $TARGET/$SECRET/suena -H'x-title: '$title -H'x-artist: '$artist -H'x-album: '$album
24
else
25
curl -v -XPOST $TARGET/$SECRET/no_suena -H'x-msg: '(cat msg)
26
end
27
end
28
29
sleep 5
30
end
31