···66import Return exposing (return)
77import Return.Ext as Return
88import Tracks
99+import UI.Common.State as Common
910import UI.DnD as DnD
1011import UI.Page as Page
1112import UI.Playlists.State as Playlists
···7374 { model | dnd = d }
7475 in
7576 if DnD.hasDropped d then
7676- case model.page of
7777+ case m.page of
7778 Page.Queue _ ->
7879 let
7980 ( from, to ) =
···83848485 newFuture =
8586 Queue.moveItem
8686- { from = from, to = to, shuffle = model.shuffle }
8787- model.playingNext
8787+ { from = from, to = to, shuffle = m.shuffle }
8888+ m.playingNext
8889 in
8990 Queue.fill { m | playingNext = newFuture }
90919192 Page.Index ->
9292- case model.scene of
9393+ let
9494+ trackCanBeMoved =
9595+ not m.favouritesOnly && Maybe.isNothing m.searchTerm
9696+ in
9797+ case m.scene of
9398 Tracks.Covers ->
9499 -- TODO
95100 Return.singleton m
9610197102 Tracks.List ->
9898- Playlists.moveTrackInSelected
9999- { to = Maybe.withDefault 0 (DnD.modelTarget d) }
100100- m
103103+ if trackCanBeMoved then
104104+ Playlists.moveTrackInSelected
105105+ { to = Maybe.withDefault 0 (DnD.modelTarget d) }
106106+ m
107107+108108+ else
109109+ "Can't move tracks in a playlist whilst using favourites-only mode, or while searching."
110110+ |> Notifications.casual
111111+ |> Common.showNotificationWithModel m
101112102113 _ ->
103114 Return.singleton m