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
+76 -41

No files matched your search

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