diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9a3af86..3e0c06d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,6 @@ # Release Notes -## 1.0.14 - 2018-12-28 +## 1.0.15 - 2018-12-28 * Christmas edition ## 0.16.25 - 2018-12-18 diff --git a/src/Client/ReleaseNotes.fs b/src/Client/ReleaseNotes.fs index 8aff86f..f7d10bc 100644 --- a/src/Client/ReleaseNotes.fs +++ b/src/Client/ReleaseNotes.fs @@ -1,13 +1,13 @@ module internal ReleaseNotes -let Version = "1.0.14" +let Version = "1.0.15" let IsPrerelease = false let Notes = """ # Release Notes -## 1.0.14 - 2018-12-28 +## 1.0.15 - 2018-12-28 * Christmas edition ## 0.16.25 - 2018-12-18 diff --git a/src/Server/AzureTable.fs b/src/Server/AzureTable.fs index ebcbe1d..6367ae8 100644 --- a/src/Server/AzureTable.fs +++ b/src/Server/AzureTable.fs @@ -191,6 +191,15 @@ let saveRequest (userID:string) (token:string) = let operation = TableOperation.InsertOrReplace entity requestsTable.ExecuteAsync operation + +let savePlayListPosition (userID:string) (token:string) position = + let entity = DynamicTableEntity() + entity.PartitionKey <- userID + entity.RowKey <- token + entity.Properties.["Position"] <- EntityProperty.GeneratePropertyForInt(Nullable position) + let operation = TableOperation.InsertOrReplace entity + positionsTable.ExecuteAsync operation + let getTag (userID:string) token = task { let query = TableOperation.Retrieve(userID, token) let! r = tagsTable.ExecuteAsync(query) diff --git a/src/Server/Server.fs b/src/Server/Server.fs index bc5507d..f061f48 100644 --- a/src/Server/Server.fs +++ b/src/Server/Server.fs @@ -132,6 +132,7 @@ let previousFileEndpoint (userID,token) = let! tag = AzureTable.getTag 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 @@ -150,7 +151,7 @@ let previousFileEndpoint (userID,token) = Token = tag.Token Object = tag.Object Description = tag.Description - Action = TagActionForBox.GetFromTagAction(tag.Action,position) } + Action = TagActionForBox.GetFromTagAction(tag.Action,position) } let txt = TagForBox.Encoder tag |> Encode.toString 0 return! setBodyFromString txt next ctx @@ -166,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