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.

Show notification when adding tracks to the queue

+71 -14
+8 -2
src/Applications/UI.elm
··· 558 558 Reply.SaveTracks -> 559 559 Core.SaveTracks 560 560 561 + Reply.ShowSuccessNotification string -> 562 + ShowNotification (Notifications.success string) 563 + 564 + Reply.ShowWarningNotification string -> 565 + ShowNotification (Notifications.warning string) 566 + 561 567 Reply.ShowTracksContextMenu coordinates tracks -> 562 568 Core.ShowTracksContextMenu coordinates tracks 563 569 ··· 642 648 Ok dict -> 643 649 ShowNotification 644 650 (Notifications.stickyError 645 - ("Could not process the **" 651 + ("Could not process the _" 646 652 ++ Dict.fetch "sourceName" "" dict 647 - ++ "** source. I got the following response from the source:" 653 + ++ "_ source. I got the following response from the source:" 648 654 ) 649 655 (Dict.fetch "error" "missingError" dict) 650 656 []
+14 -3
src/Applications/UI/Notifications.elm
··· 107 107 |> onDoubleClick 108 108 ] 109 109 [ T.br2 110 - , T.measure_narrow 111 110 , T.mt2 112 111 , T.pa3 113 112 , T.white_90 113 + 114 + -- 115 + , case Notifications.kind notification of 116 + Error -> 117 + T.measure_narrow 118 + 119 + Success -> 120 + T.measure_wide 121 + 122 + Warning -> 123 + "" 114 124 115 125 -- 116 126 , if options.wasDismissed then ··· 137 147 138 148 containerStyles : List Css.Style 139 149 containerStyles = 140 - [ Css.lineHeight (Css.num 1.35) 150 + [ Css.fontSize (Css.px 13) 151 + , Css.lineHeight (Css.num 1.35) 141 152 , Css.Global.descendants 142 153 [ Css.Global.p 143 154 [ Css.margin Css.zero 144 155 , Css.padding Css.zero 145 156 ] 146 - , Css.Global.strong 157 + , Css.Global.em 147 158 [ Css.borderBottom3 (Css.px 1) Css.solid (Css.rgba 255 255 255 0.45) 148 159 , Css.fontWeight Css.inherit 149 160 ]
+43 -5
src/Applications/UI/Queue.elm
··· 43 43 InjectFirstAndPlay identifiedTrack -> 44 44 let 45 45 ( a, b, _ ) = 46 - update (InjectFirst [ identifiedTrack ]) model 46 + update (InjectFirst { showNotification = False } [ identifiedTrack ]) model 47 47 48 48 ( x, y, z ) = 49 49 update Shift a ··· 56 56 -- # InjectFirst 57 57 -- > Add an item in front of the queue. 58 58 -- 59 - InjectFirst identifiedTracks -> 59 + InjectFirst { showNotification } identifiedTracks -> 60 60 let 61 61 ( items, tracks ) = 62 62 ( List.map (makeItem True) identifiedTracks ··· 73 73 in 74 74 ( { model | future = items ++ cleanedFuture } 75 75 , Cmd.none 76 - , Just [ FillQueue ] 76 + -- Show notification 77 + -------------------- 78 + , (if showNotification then 79 + [ case tracks of 80 + [ t ] -> 81 + ShowSuccessNotification ("__" ++ t.tags.title ++ "__ will be played next") 82 + 83 + list -> 84 + list 85 + |> List.length 86 + |> String.fromInt 87 + |> (\s -> "__" ++ s ++ " tracks__ will be played next") 88 + |> ShowSuccessNotification 89 + ] 90 + 91 + else 92 + [] 93 + ) 94 + |> List.append [ FillQueue ] 95 + |> Just 77 96 ) 78 97 79 98 -- # InjectLast 80 99 -- > Add an item after the last manual entry 81 100 -- (ie. after the last injected item). 82 101 -- 83 - InjectLast identifiedTracks -> 102 + InjectLast { showNotification } identifiedTracks -> 84 103 let 85 104 ( items, tracks ) = 86 105 ( List.map (makeItem True) identifiedTracks ··· 108 127 ++ List.drop manualItems cleanedFuture 109 128 } 110 129 , Cmd.none 111 - , Just [ FillQueue ] 130 + -- Show notification 131 + -------------------- 132 + , (if showNotification then 133 + [ case tracks of 134 + [ t ] -> 135 + ShowSuccessNotification ("__" ++ t.tags.title ++ "__ was added to the queue") 136 + 137 + list -> 138 + list 139 + |> List.length 140 + |> String.fromInt 141 + |> (\s -> "__" ++ s ++ " tracks__ were added to the queue") 142 + |> ShowSuccessNotification 143 + ] 144 + 145 + else 146 + [] 147 + ) 148 + |> List.append [ FillQueue ] 149 + |> Just 112 150 ) 113 151 114 152 -----------------------------------------
+2 -2
src/Applications/UI/Queue/Core.elm
··· 33 33 ------------------------------------ 34 34 -- Future 35 35 ------------------------------------ 36 - | InjectFirst (List IdentifiedTrack) 37 - | InjectLast (List IdentifiedTrack) 36 + | InjectFirst { showNotification : Bool } (List IdentifiedTrack) 37 + | InjectLast { showNotification : Bool } (List IdentifiedTrack) 38 38 ------------------------------------ 39 39 -- Position 40 40 ------------------------------------
+2
src/Applications/UI/Reply.elm
··· 32 32 | SaveSettings 33 33 | SaveSources 34 34 | SaveTracks 35 + | ShowSuccessNotification String 36 + | ShowWarningNotification String 35 37 | ShowTracksContextMenu Coordinates (List IdentifiedTrack) 36 38 | ToggleLoadingScreen Switch
+2 -2
src/Applications/UI/Tracks/ContextMenu.elm
··· 25 25 queueActions identifiedTracks = 26 26 [ ( Icons.event_seat 27 27 , "Play next" 28 - , QueueMsg (Queue.InjectFirst identifiedTracks) 28 + , QueueMsg (Queue.InjectFirst { showNotification = True } identifiedTracks) 29 29 ) 30 30 , ( Icons.event_seat 31 31 , "Add to queue" 32 - , QueueMsg (Queue.InjectLast identifiedTracks) 32 + , QueueMsg (Queue.InjectLast { showNotification = True } identifiedTracks) 33 33 ) 34 34 ]