diff --git a/src/Applications/UI.elm b/src/Applications/UI.elm index afe18841..c3df8eb2 100644 --- a/src/Applications/UI.elm +++ b/src/Applications/UI.elm @@ -757,13 +757,25 @@ translateReply reply model = , tracks = tracks } playlistsModel.collection + + newModel = + { playlistsModel + | collection = newCollection + , lastModifiedPlaylist = Just properPlaylistName + } + |> (\m -> { model | playlists = m }) in - { playlistsModel - | collection = newCollection - , lastModifiedPlaylist = Just properPlaylistName - } - |> (\m -> { model | playlists = m }) - |> translateReply SavePlaylists + (case tracks of + [ t ] -> + "Added __" ++ t.title ++ "__" + + l -> + "Added __" ++ String.fromInt (List.length l) ++ " tracks__" + ) + |> (\s -> s ++ " to the __" ++ properPlaylistName ++ "__ playlist") + |> ShowSuccessNotification + |> (\r -> translateReply r newModel) + |> andThen (translateReply SavePlaylists) DeactivatePlaylist -> update (TracksMsg <| Tracks.DeselectPlaylist) model diff --git a/src/Library/Tracks.elm b/src/Library/Tracks.elm index 03e16956..51e492fa 100644 --- a/src/Library/Tracks.elm +++ b/src/Library/Tracks.elm @@ -182,6 +182,10 @@ emptyCollection = } + +-- MORE STUFF + + isNowPlaying : IdentifiedTrack -> IdentifiedTrack -> Bool isNowPlaying ( a, b ) ( x, y ) = a.indexInPlaylist == x.indexInPlaylist && b.id == y.id