mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Fix sorting when converting a shuffled into a linear playlist
This commit is contained in:
parent
e142e162a5
commit
b529b2fabe
3 changed files with 16 additions and 5 deletions
|
|
@ -27,7 +27,7 @@
|
|||
"This function is used if we switch from linear to shuffled; it allows us to
|
||||
restore the order of the queue when it was created."
|
||||
[items]
|
||||
(->> (sort-by (comp meta :playlist/linear-order) items)
|
||||
(->> (sort-by (comp :playlist/linear-order meta) items)
|
||||
(map-indexed (fn [idx item]
|
||||
(vary-meta item assoc :playlist/linear-order idx)))))
|
||||
|
||||
|
|
@ -85,7 +85,8 @@
|
|||
queue-fn (case playback-mode
|
||||
:shuffled shuffled-queue
|
||||
:linear linear-queue)
|
||||
next-playlist (update playlist :items (comp queue-fn vals))
|
||||
next-playlist (-> (assoc playlist :playback-mode playback-mode)
|
||||
(update :items (comp queue-fn vals)))
|
||||
next-idx (first (keep (fn [[idx song]]
|
||||
(when (= song current-song)
|
||||
idx))
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
[:td.sort-handle.is-narrow [:> SortHandle]]
|
||||
[:td.song-artist [artist-link song]]
|
||||
[:td.song-title (:title song)]
|
||||
[:td.meta>code (str (meta song))]
|
||||
[:td.song-duration (helpers/format-duration (:duration song) :brief? true)]
|
||||
[:td.song-actions.is-narrow [song-actions]]])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue