A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Playlist deletion confirmation

+44 -8
+1
CHANGELOG.md
··· 3 3 ## 2.3.0 4 4 5 5 - Adds ability to download a playlist as a zip file 6 + - Asks for confirmation when removing a playlist 6 7 - Fixes dark styles for add-to-playlist overlay 7 8 - Improves CORS information a little bit 8 9 - Improves playlist drag & drop (now moves selection instead of item under cursor)
+16 -3
src/Applications/UI.elm
··· 112 112 113 113 type alias Model = 114 114 { contextMenu : Maybe (ContextMenu Reply) 115 + , confirmation : Maybe String 115 116 , currentTime : Time.Posix 116 117 , darkMode : Bool 117 118 , debounce : Debouncer Msg Msg ··· 169 170 Maybe.withDefault Page.Index maybePage 170 171 in 171 172 { contextMenu = Nothing 173 + , confirmation = Nothing 172 174 , currentTime = Time.millisToPosix flags.initialTime 173 175 , darkMode = flags.darkMode 174 176 , downloading = Nothing ··· 1075 1077 ----------------------------------------- 1076 1078 -- Context Menu 1077 1079 ----------------------------------------- 1080 + ContextMenuConfirmation conf r -> 1081 + { model | confirmation = Just conf } 1082 + |> return 1083 + |> andThen (translateReply r) 1084 + 1078 1085 ReplyViaContextMenu r -> 1079 - translateReply r { model | contextMenu = Nothing } 1086 + case r of 1087 + ContextMenuConfirmation _ _ -> 1088 + translateReply r model 1089 + 1090 + _ -> 1091 + translateReply r { model | contextMenu = Nothing } 1080 1092 1081 1093 ShowMoreAuthenticationOptions coordinates -> 1082 1094 return { model | contextMenu = Just (Authentication.moreOptionsMenu coordinates) } 1083 1095 1084 1096 ShowPlaylistListMenu coordinates playlist -> 1085 - return { model | contextMenu = Just (Playlists.listMenu playlist model.tracks.collection.identified coordinates) } 1097 + return { model | contextMenu = Just (Playlists.listMenu playlist model.tracks.collection.identified model.confirmation coordinates) } 1086 1098 1087 1099 ShowQueueFutureMenu coordinates { item, itemIndex } -> 1088 1100 return { model | contextMenu = Just (Queue.futureMenu { cached = model.tracks.cached, cachingInProgress = model.tracks.cachingInProgress, itemIndex = itemIndex } item coordinates) } ··· 1262 1274 args 1263 1275 |> Playlists.RemoveFromCollection 1264 1276 |> PlaylistsMsg 1265 - |> updateWithModel model 1277 + |> updateWithModel { model | confirmation = Nothing } 1266 1278 1267 1279 ReplacePlaylistInCollection playlist -> 1268 1280 let ··· 1718 1730 hideOverlay model = 1719 1731 ( { model 1720 1732 | alfred = { instance = Nothing } 1733 + , confirmation = Nothing 1721 1734 , contextMenu = Nothing 1722 1735 } 1723 1736 --
+26 -5
src/Applications/UI/Playlists/ContextMenu.elm
··· 19 19 -- 🔱 20 20 21 21 22 - listMenu : Playlist -> List IdentifiedTrack -> Coordinates -> ContextMenu Reply 23 - listMenu playlist allTracks = 22 + listMenu : Playlist -> List IdentifiedTrack -> Maybe String -> Coordinates -> ContextMenu Reply 23 + listMenu playlist allTracks confirmation coordinates = 24 24 let 25 25 ( identifiedTracksFromPlaylist, _ ) = 26 26 Playlists.Matching.match playlist allTracks ··· 29 29 identifiedTracksFromPlaylist 30 30 |> List.sortBy (Tuple.first >> .indexInPlaylist >> Maybe.withDefault 0) 31 31 |> List.map Tuple.second 32 + 33 + playlistId = 34 + "Playlist - " ++ playlist.name 35 + 36 + menuReply = 37 + ShowPlaylistListMenu coordinates playlist 38 + 39 + askForConfirmation = 40 + confirmation == Just playlistId 32 41 in 33 42 ContextMenu 34 43 [ Item ··· 50 59 } 51 60 , Item 52 61 { icon = Icons.delete 53 - , label = "Remove playlist" 54 - , msg = RemovePlaylistFromCollection { playlistName = playlist.name } 55 - , active = False 62 + , label = 63 + if askForConfirmation then 64 + "Are you sure?" 65 + 66 + else 67 + "Remove playlist" 68 + , msg = 69 + if askForConfirmation then 70 + RemovePlaylistFromCollection { playlistName = playlist.name } 71 + 72 + else 73 + ContextMenuConfirmation playlistId menuReply 74 + , active = 75 + askForConfirmation 56 76 } 57 77 , Item 58 78 { icon = Icons.offline_bolt ··· 61 81 , active = False 62 82 } 63 83 ] 84 + coordinates
+1
src/Applications/UI/Reply.elm
··· 39 39 ----------------------------------------- 40 40 -- Context Menu 41 41 ----------------------------------------- 42 + | ContextMenuConfirmation String Reply 42 43 | ReplyViaContextMenu Reply 43 44 | ShowMoreAuthenticationOptions Coordinates 44 45 | ShowPlaylistListMenu Coordinates Playlist