From 437faa812085ed23678d3738c5a56d0a5f3f571a Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 11 Mar 2024 22:43:47 -0400 Subject: [PATCH] fixed queueing and tweaked css --- atv/assets/admin.html | 6 ++++++ atv/assets/control.html | 39 ++++++++++++++++++++++++++++++--------- atv/lib/atv/channel.rb | 2 +- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/atv/assets/admin.html b/atv/assets/admin.html index 719cbec..13ec436 100644 --- a/atv/assets/admin.html +++ b/atv/assets/admin.html @@ -87,6 +87,12 @@ margin-right: 1em; } + #queueList div { + background-color: #A7BDC7; + padding: 1em; + margin: 0.5em; + text-align: left; + } diff --git a/atv/assets/control.html b/atv/assets/control.html index 2e0f5e3..f5657dd 100644 --- a/atv/assets/control.html +++ b/atv/assets/control.html @@ -87,6 +87,18 @@ margin-right: 1em; } + #itemList div { + background-color: #A7BDC7; + padding: 1em; + margin: 0.5em; + } + + #queueList div { + background-color: #A7BDC7; + padding: 1em; + margin: 0.5em; + text-align: left; + } @@ -104,10 +116,11 @@ Some Other File +

Queued Videos

+
-

Queued Videos

The queue is currently empty
@@ -194,8 +207,6 @@ const UI = (()=>{ refreshItems(); }; - - const refreshQueue = ()=>{ if (queue.length > 0) { queueList.innerHTML = ""; @@ -229,16 +240,26 @@ const UI = (()=>{ itemList.innerText = ""; for (const item in dir) { const el = document.createElement("div"); - const link = document.createElement("a"); - link.innerText = item; - link.href = '#'; + el.innerText = item; if ('path' in dir[item]) { - link.onclick = ()=>{ self.enqueue(dir[item].path); }; + el.onclick = ()=>{ self.enqueue(dir[item].path); }; } else { - link.onclick = ()=>{ linkDown(item); }; + el.onclick = ()=>{ linkDown(item); }; } - el.appendChild(link); itemList.appendChild(el); + + + +// const link = document.createElement("a"); +// link.innerText = item; +// link.href = '#'; +// if ('path' in dir[item]) { +// link.onclick = ()=>{ self.enqueue(dir[item].path); }; +// } else { +// link.onclick = ()=>{ linkDown(item); }; +// } +// el.appendChild(link); +// itemList.appendChild(el); } }; diff --git a/atv/lib/atv/channel.rb b/atv/lib/atv/channel.rb index 9a1842f..461b096 100644 --- a/atv/lib/atv/channel.rb +++ b/atv/lib/atv/channel.rb @@ -55,7 +55,7 @@ module ATV end def enqueue(path) - @queue << filedata[:map][path] if filedata[:map][path] + @queue << filedata[:items][path] if filedata[:items][path] end private -- 2.52.0