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.

at main 203 lines 5.8 kB view raw
1module UI.Demo exposing (tape) 2 3import Base64 4import Dict 5import Json.Encode as Json 6import Sources exposing (Service(..), Source) 7import Sources.Encoding as Sources 8import Time 9import Tracks exposing (Favourite, Track) 10import Tracks.Encoding as Tracks 11 12 13 14-- ⛩ 15 16 17tape : Time.Posix -> Json.Value 18tape currentTime = 19 Json.object 20 [ ( "favourites", Json.list Tracks.encodeFavourite favourites ) 21 , ( "sources", Json.list Sources.encode sources ) 22 , ( "tracks", Json.list Tracks.encodeTrack <| tracks currentTime ) 23 ] 24 25 26 27-- ㊙️ 28 29 30favourites : List Favourite 31favourites = 32 [ { artist = Just "James Blake" 33 , title = "Essential Mix (09-17-2011)" 34 } 35 ] 36 37 38sources : List Source 39sources = 40 let 41 key = 42 "QUtJQTZPUTNFVk1BWFZDRFFINkI=" 43 |> Base64.decode 44 |> Result.withDefault "" 45 46 secret = 47 "Z0hPQkdHRzU1aXc0a0RDbjdjWlRJYTVTUDRZWnpERkRzQnFCYWI4Mg==" 48 |> Base64.decode 49 |> Result.withDefault "" 50 in 51 [ { id = "15076402187342" 52 , data = 53 Dict.fromList 54 [ ( "accessKey", key ) 55 , ( "bucketName", "ongaku-ryoho-demo" ) 56 , ( "directoryPath", "/" ) 57 , ( "name", "Demo" ) 58 , ( "region", "us-east-1" ) 59 , ( "secretKey", secret ) 60 ] 61 , directoryPlaylists = True 62 , enabled = True 63 , service = AmazonS3 64 } 65 ] 66 67 68tracks : Time.Posix -> List Track 69tracks insertedAt = 70 [ { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvKFNXTDAxMyktb3JpSmFudXMtV0VCLTIwMTQtRlJFRS8wMS1ib25pdGEubXAz" 71 , path = "Free music/(SWL013)-oriJanus-WEB-2014-FREE/01-bonita.mp3" 72 , sourceId = "15076402187342" 73 , insertedAt = insertedAt 74 , tags = 75 { disc = 1 76 , nr = 1 77 78 -- 79 , album = Just "Soulection White Label: 013" 80 , artist = Just "oriJanus" 81 , title = "Bonita" 82 83 -- 84 , genre = Just "Soulection" 85 , picture = Nothing 86 , year = Nothing 87 } 88 } 89 , { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvKFNXTDAxMyktb3JpSmFudXMtV0VCLTIwMTQtRlJFRS8wMi02Lm1wMw" 90 , path = "Free music/(SWL013)-oriJanus-WEB-2014-FREE/02-6.mp3" 91 , sourceId = "15076402187342" 92 , insertedAt = insertedAt 93 , tags = 94 { disc = 1 95 , nr = 2 96 97 -- 98 , album = Just "Soulection White Label: 013" 99 , artist = Just "oriJanus" 100 , title = "6" 101 102 -- 103 , genre = Just "Soulection" 104 , picture = Nothing 105 , year = Nothing 106 } 107 } 108 , { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvKFNXTDAxMyktb3JpSmFudXMtV0VCLTIwMTQtRlJFRS8wMy1ob3RfcmVtaXhfZnQuX3Rlay5sdW5fJl96aWtvbW8ubXAz" 109 , path = "Free music/(SWL013)-oriJanus-WEB-2014-FREE/03-hot_remix_ft._tek.lun_&_zikomo.mp3" 110 , sourceId = "15076402187342" 111 , insertedAt = insertedAt 112 , tags = 113 { disc = 1 114 , nr = 3 115 116 -- 117 , album = Just "Soulection White Label: 013" 118 , artist = Just "oriJanus" 119 , title = "Hot Remix ft. Tek.Lun & Zikomo" 120 121 -- 122 , genre = Just "Soulection" 123 , picture = Nothing 124 , year = Nothing 125 } 126 } 127 , { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvQ29tX1RydWlzZS1DaGVtaWNhbF9MZWdzLTIwMTItRlJFRS8wMS1jb21fdHJ1aXNlLWNoZW1pY2FsX2xlZ3MubXAz" 128 , path = "Free music/Com_Truise-Chemical_Legs-2012-FREE/01-com_truise-chemical_legs.mp3" 129 , sourceId = "15076402187342" 130 , insertedAt = insertedAt 131 , tags = 132 { disc = 1 133 , nr = 9 134 135 -- 136 , album = Just "Adult Swim Singles Project 2012" 137 , artist = Just "Com Truise" 138 , title = "Chemical Legs" 139 140 -- 141 , genre = Nothing 142 , picture = Nothing 143 , year = Just 2012 144 } 145 } 146 , { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvTWFudWVsZV9BdHplbmlfLV8wNF8tX0xpdHRsZV9TdGFyLm1wMw" 147 , path = "Free music/Manuele_Atzeni_-_04_-_Little_Star.mp3" 148 , sourceId = "15076402187342" 149 , insertedAt = insertedAt 150 , tags = 151 { disc = 1 152 , nr = 4 153 154 -- 155 , album = Just "The Miyazaki Tour EP" 156 , artist = Just "Manuele Atzeni" 157 , title = "Little Star" 158 159 -- 160 , genre = Just "Funk" 161 , picture = Nothing 162 , year = Nothing 163 } 164 } 165 , { id = "MTUwNzY0MDIxODczNDIvL0ZyZWUgbXVzaWMvUGF0cmlja19MZWVfLV8wMl8tX1F1aXR0aW5fVGltZS5tcDM" 166 , path = "Free music/Patrick_Lee_-_02_-_Quittin_Time.mp3" 167 , sourceId = "15076402187342" 168 , insertedAt = insertedAt 169 , tags = 170 { disc = 1 171 , nr = 2 172 173 -- 174 , album = Just "The Last Thing" 175 , artist = Just "Patrick Lee" 176 , title = "Quittin' Time" 177 178 -- 179 , genre = Just "Electronic" 180 , picture = Nothing 181 , year = Nothing 182 } 183 } 184 , { id = "MTUwNzY0MDIxODczNDIvL1JhZGlvL2phbWVzX2JsYWtlLWVzc2VudGlhbF9taXgtc2F0LTA5LTE3LTIwMTEubXAz" 185 , path = "Radio/james_blake-essential_mix-sat-09-17-2011.mp3" 186 , sourceId = "15076402187342" 187 , insertedAt = insertedAt 188 , tags = 189 { disc = 1 190 , nr = 1 191 192 -- 193 , album = Just "Essential Mix-SAT-09-17" 194 , artist = Just "James Blake" 195 , title = "Essential Mix (09-17-2011)" 196 197 -- 198 , genre = Just "Electronic" 199 , picture = Nothing 200 , year = Nothing 201 } 202 } 203 ]