1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-07 02:33:39 +02:00

Implement set-current-track

This commit is contained in:
heyarne 2019-03-05 13:49:16 +01:00
commit 4043eb48e7
6 changed files with 67 additions and 32 deletions

View file

@ -17,3 +17,19 @@
(from arr #(-> (str 0 (.toString % 16))
(.substr -2)))
(join "")))))
(defn song []
(hash-map :id (rand-int 9999)
:coverArt (rand-int 9999)
:year (+ 1900 (rand-int 118))
:artist (rand-str)
:artistId (rand-int 100000)
:title (rand-str)
:album (rand-str)))
(defn song-queue
"Generates a seq of n different songs"
[n]
(let [r-int (atom 0)]
(with-redefs [rand-int #(mod (swap! r-int inc) %1)]
(repeatedly n song))))