summaryrefslogtreecommitdiff
path: root/src/lib/http_server.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-02-03 00:26:29 +0100
committerCarl Hetherington <cth@carlh.net>2026-04-25 12:55:26 +0200
commit10e23506c4e3760ec9af56eb5c8b649530ba098a (patch)
tree86123021a7944b131527ebdcc48f0fff5846cb8f /src/lib/http_server.cc
parent9807a34bf1b82ae30a91edd2e6774d614fed728d (diff)
Support current playlist in the web interface.
Diffstat (limited to 'src/lib/http_server.cc')
-rw-r--r--src/lib/http_server.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/http_server.cc b/src/lib/http_server.cc
index 43b4cbb84..83ad2551c 100644
--- a/src/lib/http_server.cc
+++ b/src/lib/http_server.cc
@@ -134,6 +134,13 @@ HTTPServer::get_request(string const& url)
json.push_back(spl.second.as_json());
}
return Response(200, json.dump(), Response::Type::JSON);
+ } else if (url == "/api/v1/current-playlist") {
+ nlohmann::json json;
+ boost::mutex::scoped_lock lm(_mutex);
+ for (auto entry: _current_playlist) {
+ json.push_back(entry);
+ }
+ return Response(200, json.dump(), Response::Type::JSON);
} else if (boost::algorithm::starts_with(url, "/api/v1/content/")) {
vector<string> parts;
boost::algorithm::split(parts, url, boost::is_any_of("/"));