Skip to content

Commit

Permalink
Bumping version to 0.16.5
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 15, 2018
1 parent 2ceeec9 commit 08194f8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM microsoft/dotnet:2.2.0-runtime
COPY /deploy .
ADD https://yt-dl.org/downloads/latest/youtube-dl youtube-dl
RUN chmod a+rx youtube-dl
ADD https://yt-dl.org/downloads/latest/youtube-dl /usr/local/bin/youtube-dl
RUN chmod a+rx /usr/local/bin/youtube-dl
WORKDIR .
EXPOSE 8085
ENTRYPOINT ["dotnet", "Server.dll"]
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes

## 0.16.4 - 2018-12-15
## 0.16.5 - 2018-12-15
* Update to ASP.NET 2.2

## 0.15.11 - 2018-11-05
Expand Down
4 changes: 2 additions & 2 deletions src/Client/ReleaseNotes.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module internal ReleaseNotes

let Version = "0.16.4"
let Version = "0.16.5"

let IsPrerelease = false

let Notes = """
# Release Notes
## 0.16.4 - 2018-12-15
## 0.16.5 - 2018-12-15
* Update to ASP.NET 2.2
## 0.15.11 - 2018-11-05
Expand Down
36 changes: 36 additions & 0 deletions src/Server/Server.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ open System.Threading.Tasks
open Giraffe.WebSocket
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open System.Diagnostics

#if DEBUG
let publicPath = Path.GetFullPath "../Client/public"
Expand Down Expand Up @@ -138,6 +139,40 @@ let firmwareEndpoint =
}


let discoverYoutubeLink (youtubeURL:string) = task {
let lines = System.Collections.Generic.List<_>()
let proc = new Process ()
let startInfo = new ProcessStartInfo()
startInfo.FileName <- "sudo"
startInfo.Arguments <- sprintf "youtube-dl -g \"%s\"" youtubeURL
startInfo.UseShellExecute <- false
startInfo.RedirectStandardOutput <- true
startInfo.CreateNoWindow <- true
proc.StartInfo <- startInfo

proc.Start() |> ignore
while not proc.StandardOutput.EndOfStream do
let! line = proc.StandardOutput.ReadLineAsync()
lines.Add line

let lines = Seq.toArray lines
let links =
lines
|> Array.filter (fun x -> x.Contains "&mime=audio")

return youtubeURL,links
}

let discoverEndpoint (url) =
pipeline {
set_header "Content-Type" "application/json"
plug (fun next ctx -> task {
let! tag = discoverYoutubeLink url

return! setBodyFromString (sprintf "%A" tag) next ctx
})
}

let tagHistoryBroadcaster = ConnectionManager()

let t = task {
Expand All @@ -154,6 +189,7 @@ let webApp =
postf "/api/upload/%s" uploadEndpoint
get "/api/startup" startupEndpoint
get "/api/firmware" firmwareEndpoint
get "/api/discover" (discoverEndpoint "https://www.youtube.com/watch?v=kfSlg3HtaSw")
get "/api/latestfirmware" getLatestFirmware
getf "/api/taghistorysocket/%s" (TagHistorySocket.openSocket tagHistoryBroadcaster)
}
Expand Down

0 comments on commit 08194f8

Please sign in to comment.