nushell: Ranges are inclusive

This commit is contained in:
Erwin Boskma 2023-07-14 10:40:10 +02:00
parent 014bab378e
commit 7bc21ac933
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)
mpc clear
let streamIndex = (random integer ..($playlist | length))
let streamIndex = (random integer ..(($playlist | length) - 1))
echo $"Playing stream ($streamIndex)"
let stream = ($playlist | get $streamIndex)
mpc add $stream