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.

Set proper source id

+31 -3
+14 -1
src/Applications/UI.elm
··· 20 20 import Sources 21 21 import Sources.Encoding 22 22 import Tachyons.Classes as T 23 + import Time 23 24 import Tracks.Encoding 24 25 import UI.Authentication 25 26 import UI.Backdrop ··· 101 102 { model | isAuthenticated = True, isLoading = False } 102 103 |> UI.UserData.importHypaethral json 103 104 |> Replying.reducto update translateReply 105 + 106 + SetCurrentTime time -> 107 + let 108 + sources = 109 + model.sources 110 + in 111 + ( { model | sources = { sources | currentTime = time } } 112 + , Cmd.none 113 + ) 104 114 105 115 ToggleLoadingScreen On -> 106 116 ( { model | isLoading = True } ··· 265 275 266 276 subscriptions : Model -> Sub Msg 267 277 subscriptions _ = 268 - Ports.fromBrain translateAlienEvent 278 + Sub.batch 279 + [ Ports.fromBrain translateAlienEvent 280 + , Time.every (60 * 1000) SetCurrentTime 281 + ] 269 282 270 283 271 284 translateAlienEvent : Alien.Event -> Msg
+2
src/Applications/UI/Core.elm
··· 5 5 import Browser 6 6 import Browser.Navigation as Nav 7 7 import Json.Encode as Json 8 + import Time 8 9 import UI.Backdrop 9 10 import UI.Page exposing (Page) 10 11 import UI.Sources ··· 48 49 = Bypass 49 50 | LoadEnclosedUserData Json.Value 50 51 | LoadHypaethralUserData Json.Value 52 + | SetCurrentTime Time.Posix 51 53 | ToggleLoadingScreen Switch 52 54 ----------------------------------------- 53 55 -- Children
+4 -1
src/Applications/UI/Sources.elm
··· 13 13 import Sources exposing (..) 14 14 import Sources.Services as Services 15 15 import Tachyons.Classes as T 16 + import Time 16 17 import UI.Kit exposing (ButtonType(..), select) 17 18 import UI.List 18 19 import UI.Navigation exposing (..) ··· 27 28 28 29 type alias Model = 29 30 { collection : List Source 31 + , currentTime : Time.Posix 30 32 , form : Form.Model 31 33 , isProcessing : Bool 32 34 } ··· 35 37 initialModel : Model 36 38 initialModel = 37 39 { collection = [] 40 + , currentTime = Time.millisToPosix 0 38 41 , form = Form.initialModel 39 42 , isProcessing = False 40 43 } ··· 81 84 -- Collection 82 85 ----------------------------------------- 83 86 AddToCollection source -> 84 - -- TODO: Set proper source id 85 87 source 88 + |> setProperId (List.length model.collection + 1) model.currentTime 86 89 |> List.singleton 87 90 |> List.append model.collection 88 91 |> (\c -> { model | collection = c })
+11 -1
src/Library/Sources.elm
··· 1 - module Sources exposing (Page(..), Property, Service(..), Source, SourceData) 1 + module Sources exposing (Page(..), Property, Service(..), Source, SourceData, setProperId) 2 2 3 3 import Dict exposing (Dict) 4 + import Time 4 5 5 6 6 7 ··· 47 48 type Page 48 49 = Index 49 50 | New 51 + 52 + 53 + 54 + --- 🔱 55 + 56 + 57 + setProperId : Int -> Time.Posix -> Source -> Source 58 + setProperId n time source = 59 + { source | id = String.fromInt (Time.toMillis Time.utc time) ++ String.fromInt n }