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

Use better identifier for generated covers

Makes sure that covers look the same, no matter if generated from an album or
individual track
This commit is contained in:
Arne Schlüter 2018-06-03 15:54:23 +02:00
commit af344d290b

View file

@ -11,7 +11,8 @@
(defn palette (defn palette
"Generate a hsl palette of two colors that's unique for a given item" "Generate a hsl palette of two colors that's unique for a given item"
[item] [item]
(let [[h s l] (js->clj (.hsl color-hash (str (:name item) (:artist item)))) (let [identifier (str (:artistId item) "-" (or (:albumId item) (:id item)))
[h s l] (js->clj (.hsl color-hash identifier))
s (str (* 100 s) "%") s (str (* 100 s) "%")
l (str (* 100 l) "%")] l (str (* 100 l) "%")]
(->> (->>