summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-01-31 00:59:50 +0100
committerCarl Hetherington <cth@carlh.net>2026-02-16 01:20:39 +0100
commit0e057a0fc38586ea55746173ca11446eef6d5865 (patch)
tree93cb177c37436ae5dbab075c05ee9fa7da939006 /web
parent651722fb46269ff06e5ff41227fd874ed5fd9854 (diff)
Support playlist load from the web interface.
Diffstat (limited to 'web')
-rw-r--r--web/index.html10
-rw-r--r--web/playlists.html4
2 files changed, 13 insertions, 1 deletions
diff --git a/web/index.html b/web/index.html
index b0b5b4505..91e3e0bf1 100644
--- a/web/index.html
+++ b/web/index.html
@@ -18,6 +18,13 @@ setInterval(function() {
});
}, 250);
function play() {
+ entries = [];
+ var nextPlaylist = document.getElementById('next-playlist').children[0].children;
+ for (var i = 0; i < nextPlaylist.length; i++) {
+ entries.push({"uuid": nextPlaylist[i].uuid, "crop_to_ratio": nextPlaylist[i].crop_to_ratio});
+ }
+ console.log(JSON.stringify({"entries": entries}));
+ fetch("/api/v1/load-playlist", { method: "POST", body: JSON.stringify({"entries": entries}) });
fetch("/api/v1/play", { method: "POST" });
}
function stop() {
@@ -49,9 +56,10 @@ function showPlaylists()
data.content.forEach(content => {
var li = document.createElement("li");
li.appendChild(document.createTextNode(content.name));
+ li.uuid = content.uuid;
+ li.crop_to_ratio = content.crop_to_ratio;
ul.appendChild(li);
});
- console.log(data);
})
});
};
diff --git a/web/playlists.html b/web/playlists.html
index 3d2e37f41..723b2ec6c 100644
--- a/web/playlists.html
+++ b/web/playlists.html
@@ -306,6 +306,8 @@ ul#content {
SIDEBAR
+<div style="margin-left: 15%;">
+
<div style="width: 45%; display: inline-block; margin-right: 3em;">
<p>Playlists: <button onclick="newPlaylist();">Add</button> <button id="remove-playlist" onclick="removeSelectedPlaylist();">Remove</button>
<ul id="playlists">
@@ -324,6 +326,8 @@ SIDEBAR
</ul>
</div>
+</div>
+
</body>
</html>