fixed switch and updated status deletion

This commit is contained in:
admin_rb committed 2025-12-21 18:31:22 +01:00
1 parent 76def50a68
commit 9f9383d4a9
2 files changed
+124 -89

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@ router.post("/clear-queued", async (req, res) => {
const db = await getDb(); const db = await getDb();
await db await db
.collection("queue") .collection("queue")
.deleteMany({ processing: { $ne: 1 } }) //delete all .deleteMany({ processing: { $ne: true } }) //delete all not currently processing
// Redirect to status, controller fetches everything // Redirect to status, controller fetches everything
res.redirect("/status"); res.redirect("/status");
+123 -88
View File
@@ -1,115 +1,150 @@
<%- include("partials/header") %> <%- include("partials/header") %>
<div class="card card-dark p-4"> <div class="card card-dark p-4">
<div class="d-flex justify-content-center mb-4"> <!-- MODE TOGGLE -->
<div class="pill-toggle" id="pillToggle"> <div class="d-flex justify-content-center mb-4">
<div class="pill-option active" data-mode="series" id="pillSeries"> <div class="pill-toggle">
Series <div class="pill-option active" id="pillSeries">Series</div>
</div> <div class="pill-option" id="pillVideo">Video</div>
<div class="pill-option" data-mode="video" id="pillVideo">Video</div> <div class="pill-indicator" id="pillIndicator"></div>
<div class="pill-indicator" id="pillIndicator"></div> </div>
</div>
<form method="POST" action="/queue" id="jobForm">
<input type="hidden" name="mode" id="modeInput" value="series" />
<!-- ===================== -->
<!-- 1. ID / URL -->
<!-- ===================== -->
<!-- SERIES: ID -->
<div id="seriesFields">
<div class="mb-3">
<label class="form-label">ID</label>
<input
class="form-control"
name="id"
type="number"
placeholder="ID"
/>
</div> </div>
</div> </div>
<form method="POST" action="/queue" id="jobForm"> <!-- VIDEO: URL -->
<input type="hidden" name="mode" id="modeInput" value="series" /> <div id="videoFields" style="display: none">
<!-- SERIES FIELDS -->
<div id="seriesFields">
<div class="mb-3">
<label class="form-label">ID</label>
<input class="form-control" name="id" type="number" placeholder="ID" />
</div>
<div class="mb-3">
<label class="form-label">Titel (ohne Extension)</label>
<input class="form-control" name="name" placeholder="Titel S01E01" />
</div>
</div>
<!-- VIDEO FIELDS -->
<div id="videoFields" style="display: none">
<div class="mb-3">
<label class="form-label">URL</label>
<input class="form-control" name="url" placeholder="https://proxer.me/watch/..." />
</div>
<div class="mb-3">
<label class="form-label">Titel</label>
<input class="form-control" name="filename" placeholder="Titel S01E01" />
</div>
</div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Language</label> <label class="form-label">URL</label>
<select class="form-select" name="language"> <input
<option value="engsub">EngSub</option> class="form-control"
<option value="engdub">EngDub</option> name="url"
<option value="gersub">GerSub</option> placeholder="https://proxer.me/watch/..."
<option value="gerdub">GerDub</option> />
</select>
</div> </div>
<!-- UPDATED: EPISODE RANGE (FROM / TO) --> </div>
<!-- ===================== -->
<!-- 2. TITEL (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Titel (ohne Extension)</label>
<input
class="form-control"
name="title"
placeholder="Titel S01E01"
/>
</div>
<!-- ===================== -->
<!-- 3. LANGUAGE (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Language</label>
<select class="form-select" name="language">
<option value="engsub">EngSub</option>
<option value="engdub">EngDub</option>
<option value="gersub">GerSub</option>
<option value="gerdub">GerDub</option>
</select>
</div>
<!-- ===================== -->
<!-- 4. EPISODES (series only) -->
<!-- ===================== -->
<div id="seriesEpisodes">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Episodes</label> <label class="form-label">Episodes</label>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<input class="form-control" name="episode_from" type="number" min="1" placeholder="From" /> <input
class="form-control"
name="episode_from"
type="number"
min="1"
placeholder="From"
/>
</div> </div>
<div class="col"> <div class="col">
<input class="form-control" name="episode_to" type="number" min="1" placeholder="To" /> <input
class="form-control"
name="episode_to"
type="number"
min="1"
placeholder="To"
/>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- ===================== -->
<!-- 5. TOKEN (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Token</label>
<input
class="form-control"
name="token"
placeholder="Token"
/>
</div>
<!-- TOKEN --> <!-- ACTIONS -->
<div class="mb-3"> <div class="d-flex justify-content-between">
<label class="form-label">Token</label> <button class="btn btn-danger">Queue Download</button>
<input class="form-control" name="token" placeholder="Token" /> <a class="btn btn-outline-light" href="/status">View Queue</a>
</div> </div>
</form>
</div>
<div class="d-flex justify-content-between"> <script>
<button class="btn btn-danger">Queue Download</button> const indicator = document.getElementById("pillIndicator");
<a class="btn btn-outline-light" href="/status">View Queue</a> const btnSeries = document.getElementById("pillSeries");
</div> const btnVideo = document.getElementById("pillVideo");
</form>
</div>
<script> const modeInput = document.getElementById("modeInput");
const pill = document.getElementById("pillToggle"); const seriesFields = document.getElementById("seriesFields");
const indicator = document.getElementById("pillIndicator"); const seriesEpisodes = document.getElementById("seriesEpisodes");
const btnSeries = document.getElementById("pillSeries"); const videoFields = document.getElementById("videoFields");
const btnVideo = document.getElementById("pillVideo");
const modeInput = document.getElementById("modeInput"); function updateMode(mode) {
const seriesFields = document.getElementById("seriesFields"); const isSeries = mode === "series";
const videoFields = document.getElementById("videoFields");
function updateMode(mode) { indicator.style.transform = isSeries
if (mode === "series") { ? "translateX(0)"
indicator.style.transform = "translateX(0)"; : "translateX(100%)";
btnSeries.classList.add("active");
btnVideo.classList.remove("active");
modeInput.value = "series"; btnSeries.classList.toggle("active", isSeries);
seriesFields.style.display = ""; btnVideo.classList.toggle("active", !isSeries);
videoFields.style.display = "none";
} else { modeInput.value = mode;
indicator.style.transform = "translateX(100%)";
btnVideo.classList.add("active");
btnSeries.classList.remove("active");
modeInput.value = "video"; seriesFields.style.display = isSeries ? "" : "none";
seriesFields.style.display = "none"; seriesEpisodes.style.display = isSeries ? "" : "none";
videoFields.style.display = ""; videoFields.style.display = isSeries ? "none" : "";
} }
}
btnSeries.onclick = () => updateMode("series"); btnSeries.onclick = () => updateMode("series");
btnVideo.onclick = () => updateMode("video"); btnVideo.onclick = () => updateMode("video");
</script> </script>
<%- include("partials/footer") %> <%- include("partials/footer") %>