Add support for custom playlists

This commit is contained in:
Omar Roth
2019-08-05 18:49:13 -05:00
parent 1e34a61911
commit be055d9dcb
40 changed files with 1802 additions and 245 deletions

View File

@@ -129,7 +129,7 @@ class AuthHandler < Kemal::Handler
error_message = {"error" => ex.message}.to_json
env.response.status_code = 403
env.response.puts error_message
env.response.print error_message
end
end
end
@@ -159,7 +159,8 @@ class APIHandler < Kemal::Handler
env.response.output.rewind
if env.response.headers.includes_word?("Content-Type", "application/json")
if env.response.output.as(IO::Memory).size != 0 &&
env.response.headers.includes_word?("Content-Type", "application/json")
response = JSON.parse(env.response.output)
if fields_text = env.params.query["fields"]?
@@ -194,7 +195,7 @@ class APIHandler < Kemal::Handler
end
ensure
env.response.output = output
env.response.puts response
env.response.print response
env.response.flush
end