···77import Json.Decode as Json
88import Return
99import Return.Ext as Return
1010+import Sources exposing (Service(..))
1111+import Sources.Refresh.AccessToken
1012import Time
1113121413151416-- 🔱
1717+1818+1919+refreshedAccessToken : Json.Value -> Manager
2020+refreshedAccessToken value model =
2121+ case Json.decodeValue Sources.Refresh.AccessToken.portArgumentsDecoder value of
2222+ Ok portArguments ->
2323+ case portArguments.service of
2424+ Google ->
2525+ -- TODO:
2626+ -- 1. Find source
2727+ -- 2. Add `access token` and `expires at` to source data
2828+ -- 3. Replace source in collection
2929+ -- 4. Save user data
3030+ Return.singleton model
3131+3232+ _ ->
3333+ Return.singleton model
3434+3535+ Err err ->
3636+ Common.reportUI Alien.ToCache (Json.errorToString err) model
153716381739setCurrentTime : Time.Posix -> Manager
+3
src/Applications/Brain/Ports.elm
···9999port receiveSearchResults : (List String -> msg) -> Sub msg
100100101101102102+port refreshedAccessToken : (Json.Value -> msg) -> Sub msg
103103+104104+102105port receiveTags : (ContextForTags -> msg) -> Sub msg
103106104107
···247247We need this to play the track.
248248249249-}
250250-makeTrackUrl : Time.Posix -> SourceData -> HttpMethod -> String -> String
251251-makeTrackUrl _ srcData _ path =
250250+makeTrackUrl : Time.Posix -> String -> SourceData -> HttpMethod -> String -> String
251251+makeTrackUrl _ _ srcData _ path =
252252 if not (String.contains "/" path) && not (String.contains "." path) then
253253 -- If it still uses the old way of doing things
254254 -- (ie. each path was a cid)