Update kink script for nushell 0.86

This commit is contained in:
Erwin Boskma 2023-11-03 10:07:12 +01:00
parent d1bcd86fc6
commit ab2a3202b2
Signed by: erwin
SSH key fingerprint: SHA256:3F6Cm6I3erRqlBwEghZWAQl6eS5WrGTX1Vs/Evec1lQ

View file

@ -11,7 +11,7 @@ export def main [channel?: string] {
}) })
let playlist = ($playlist.playlist | transpose | where {|x| ($x.column0 | str starts-with "File") } | get column1) let playlist = ($playlist.playlist | transpose | where {|x| ($x.column0 | str starts-with "File") } | get column1)
mpc clear mpc clear
let streamIndex = (random integer ..(($playlist | length) - 1)) let streamIndex = (random int ..(($playlist | length) - 1))
echo $"Playing stream ($streamIndex)" echo $"Playing stream ($streamIndex)"
let stream = ($playlist | get $streamIndex) let stream = ($playlist | get $streamIndex)
mpc add $stream mpc add $stream