From 8a28d37b0f6a78228809100850886ef3e46ec33c Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 17 Mar 2019 12:53:58 +0100 Subject: [PATCH] Bumping version to 1.1.15 --- RELEASE_NOTES.md | 2 +- src/Client/Client.fs | 6 +++--- src/Client/ReleaseNotes.fs | 4 ++-- src/Server/Server.fs | 10 ++++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1cd253e..b8890bc 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,6 @@ # Release Notes -## 1.1.14 - 2019-03-17 +## 1.1.15 - 2019-03-17 * Upgrade Raspbian ## 1.1.0 - 2019-01-20 diff --git a/src/Client/Client.fs b/src/Client/Client.fs index 317a4d6..f360ba7 100644 --- a/src/Client/Client.fs +++ b/src/Client/Client.fs @@ -60,7 +60,7 @@ let fetchFirmware() = promise { } -let uploadFile (fileName,token) = promise { +let uploadFile (fileName,userID) = promise { let formData = Fable.Import.Browser.FormData.Create() formData.append("file",fileName) @@ -71,7 +71,7 @@ let uploadFile (fileName,token) = promise { //HttpRequestHeaders.ContentType "multipart/form-data" ] RequestProperties.Body (unbox formData) ] - let url = sprintf "api/upload/%s" token + let url = sprintf "api/upload/%s" userID let! res = Fetch.fetch url props let! txt = res.text() @@ -159,7 +159,7 @@ let update (msg : Msg) (model : Model) : Model * Cmd = | None -> model, Cmd.none | Some fileName -> { model with File = None; IsUploading = true; Message = "Upload started" }, - Cmd.ofPromise uploadFile (fileName,"temp") FileUploaded UploadFailed + Cmd.ofPromise uploadFile (fileName,model.UserID) FileUploaded UploadFailed | Err exn -> { model with Message = exn.Message }, Cmd.none //runIn (System.TimeSpan.FromSeconds 5.) Fetch Err diff --git a/src/Client/ReleaseNotes.fs b/src/Client/ReleaseNotes.fs index f04d938..a06b2a7 100644 --- a/src/Client/ReleaseNotes.fs +++ b/src/Client/ReleaseNotes.fs @@ -1,13 +1,13 @@ module internal ReleaseNotes -let Version = "1.1.14" +let Version = "1.1.15" let IsPrerelease = false let Notes = """ # Release Notes -## 1.1.14 - 2019-03-17 +## 1.1.15 - 2019-03-17 * Upgrade Raspbian ## 1.1.0 - 2019-01-20 diff --git a/src/Server/Server.fs b/src/Server/Server.fs index 0545ed3..62a6f47 100644 --- a/src/Server/Server.fs +++ b/src/Server/Server.fs @@ -97,7 +97,7 @@ let mapYoutube (tag:Tag) = task { | _ -> return tag } -let uploadEndpoint (token:string) = +let uploadEndpoint (userID:string) = pipeline { set_header "Content-Type" "application/json" plug (fun next ctx -> task { @@ -114,7 +114,7 @@ let uploadEndpoint (token:string) = Action = tagAction Description = "" LastVerified = DateTimeOffset.UtcNow - UserID = "temp" + UserID = userID Object = "" } let! _saved = AzureTable.saveTag tag let! tag = mapBlobMusikTag tag @@ -167,7 +167,7 @@ let nextFileEndpoint (userID,token) = let! position = AzureTable.getPlayListPosition userID token let position = position |> Option.map (fun p -> p.Position - 1) |> Option.defaultValue 0 - let! _ = AzureTable.savePlayListPosition userID token position + let! tag = match tag with | Some t -> mapBlobMusikTag t @@ -187,7 +187,9 @@ let nextFileEndpoint (userID,token) = Object = tag.Object Description = tag.Description Action = TagActionForBox.GetFromTagAction(tag.Action,position) } - + + let! _ = AzureTable.savePlayListPosition userID token position + let txt = TagForBox.Encoder tag |> Encode.toString 0 return! setBodyFromString txt next ctx })