From c07dd348787f88bd5b70705575de6ac91d0a9897 Mon Sep 17 00:00:00 2001 From: nixo Date: Tue, 21 May 2019 18:31:56 +0200 Subject: [PATCH] fix conversion --- JlSonic/api.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/JlSonic/api.jl b/JlSonic/api.jl index 3f31d40..8afd883 100644 --- a/JlSonic/api.jl +++ b/JlSonic/api.jl @@ -519,7 +519,7 @@ function giveconverted(file, bitrate, format) suffix = format mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix headers["Content-Type"] = mime - headers["Content-Length"] = length(data) + headers["Content-Length"] = string(length(data)) return Dict(:body => data, :headers => headers) end @@ -542,6 +542,8 @@ function stream(req::Dict) isa(e, ArgumentError) && 0 @error e end + # Ogg is not compativle with lower bitrates. Use something else? + bitrate = bitrate < 64 ? 64 : bitrate format = get(query, "format", "oga") songs = Beets.songs()