fixed switch and updated status deletion
This commit is contained in:
1 parent
76def50a68
commit
9f9383d4a9
2 files changed
+76
-41
No files matched your search
+1
-1
@@ -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");
|
||||||
|
|||||||
+75
-40
@@ -1,12 +1,11 @@
|
|||||||
<%- include("partials/header") %>
|
<%- include("partials/header") %>
|
||||||
|
|
||||||
<div class="card card-dark p-4">
|
<div class="card card-dark p-4">
|
||||||
|
<!-- MODE TOGGLE -->
|
||||||
<div class="d-flex justify-content-center mb-4">
|
<div class="d-flex justify-content-center mb-4">
|
||||||
<div class="pill-toggle" id="pillToggle">
|
<div class="pill-toggle">
|
||||||
<div class="pill-option active" data-mode="series" id="pillSeries">
|
<div class="pill-option active" id="pillSeries">Series</div>
|
||||||
Series
|
<div class="pill-option" id="pillVideo">Video</div>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,33 +13,50 @@
|
|||||||
<form method="POST" action="/queue" id="jobForm">
|
<form method="POST" action="/queue" id="jobForm">
|
||||||
<input type="hidden" name="mode" id="modeInput" value="series" />
|
<input type="hidden" name="mode" id="modeInput" value="series" />
|
||||||
|
|
||||||
<!-- SERIES FIELDS -->
|
<!-- ===================== -->
|
||||||
|
<!-- 1. ID / URL -->
|
||||||
|
<!-- ===================== -->
|
||||||
|
|
||||||
|
<!-- SERIES: ID -->
|
||||||
<div id="seriesFields">
|
<div id="seriesFields">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">ID</label>
|
<label class="form-label">ID</label>
|
||||||
<input class="form-control" name="id" type="number" placeholder="ID" />
|
<input
|
||||||
</div>
|
class="form-control"
|
||||||
|
name="id"
|
||||||
<div class="mb-3">
|
type="number"
|
||||||
<label class="form-label">Titel (ohne Extension)</label>
|
placeholder="ID"
|
||||||
<input class="form-control" name="name" placeholder="Titel S01E01" />
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- VIDEO FIELDS -->
|
<!-- VIDEO: URL -->
|
||||||
<div id="videoFields" style="display: none">
|
<div id="videoFields" style="display: none">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">URL</label>
|
<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>
|
</div>
|
||||||
|
|
||||||
|
<!-- ===================== -->
|
||||||
|
<!-- 2. TITEL (shared) -->
|
||||||
|
<!-- ===================== -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Titel</label>
|
<label class="form-label">Titel (ohne Extension)</label>
|
||||||
<input class="form-control" name="filename" placeholder="Titel S01E01" />
|
<input
|
||||||
</div>
|
class="form-control"
|
||||||
|
name="title"
|
||||||
|
placeholder="Titel S01E01"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- ===================== -->
|
||||||
|
<!-- 3. LANGUAGE (shared) -->
|
||||||
|
<!-- ===================== -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Language</label>
|
<label class="form-label">Language</label>
|
||||||
<select class="form-select" name="language">
|
<select class="form-select" name="language">
|
||||||
@@ -50,26 +66,49 @@
|
|||||||
<option value="gerdub">GerDub</option>
|
<option value="gerdub">GerDub</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- UPDATED: EPISODE RANGE (FROM / TO) -->
|
|
||||||
|
<!-- ===================== -->
|
||||||
|
<!-- 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>
|
||||||
|
|
||||||
|
<!-- ===================== -->
|
||||||
<!-- TOKEN -->
|
<!-- 5. TOKEN (shared) -->
|
||||||
|
<!-- ===================== -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Token</label>
|
<label class="form-label">Token</label>
|
||||||
<input class="form-control" name="token" placeholder="Token" />
|
<input
|
||||||
|
class="form-control"
|
||||||
|
name="token"
|
||||||
|
placeholder="Token"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- ACTIONS -->
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<button class="btn btn-danger">Queue Download</button>
|
<button class="btn btn-danger">Queue Download</button>
|
||||||
<a class="btn btn-outline-light" href="/status">View Queue</a>
|
<a class="btn btn-outline-light" href="/status">View Queue</a>
|
||||||
@@ -78,34 +117,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const pill = document.getElementById("pillToggle");
|
|
||||||
const indicator = document.getElementById("pillIndicator");
|
const indicator = document.getElementById("pillIndicator");
|
||||||
const btnSeries = document.getElementById("pillSeries");
|
const btnSeries = document.getElementById("pillSeries");
|
||||||
const btnVideo = document.getElementById("pillVideo");
|
const btnVideo = document.getElementById("pillVideo");
|
||||||
|
|
||||||
const modeInput = document.getElementById("modeInput");
|
const modeInput = document.getElementById("modeInput");
|
||||||
const seriesFields = document.getElementById("seriesFields");
|
const seriesFields = document.getElementById("seriesFields");
|
||||||
|
const seriesEpisodes = document.getElementById("seriesEpisodes");
|
||||||
const videoFields = document.getElementById("videoFields");
|
const videoFields = document.getElementById("videoFields");
|
||||||
|
|
||||||
function updateMode(mode) {
|
function updateMode(mode) {
|
||||||
if (mode === "series") {
|
const isSeries = mode === "series";
|
||||||
indicator.style.transform = "translateX(0)";
|
|
||||||
btnSeries.classList.add("active");
|
|
||||||
btnVideo.classList.remove("active");
|
|
||||||
|
|
||||||
modeInput.value = "series";
|
indicator.style.transform = isSeries
|
||||||
seriesFields.style.display = "";
|
? "translateX(0)"
|
||||||
videoFields.style.display = "none";
|
: "translateX(100%)";
|
||||||
|
|
||||||
} else {
|
btnSeries.classList.toggle("active", isSeries);
|
||||||
indicator.style.transform = "translateX(100%)";
|
btnVideo.classList.toggle("active", !isSeries);
|
||||||
btnVideo.classList.add("active");
|
|
||||||
btnSeries.classList.remove("active");
|
|
||||||
|
|
||||||
modeInput.value = "video";
|
modeInput.value = mode;
|
||||||
seriesFields.style.display = "none";
|
|
||||||
videoFields.style.display = "";
|
seriesFields.style.display = isSeries ? "" : "none";
|
||||||
}
|
seriesEpisodes.style.display = isSeries ? "" : "none";
|
||||||
|
videoFields.style.display = isSeries ? "none" : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
btnSeries.onclick = () => updateMode("series");
|
btnSeries.onclick = () => updateMode("series");
|
||||||
|
|||||||
Reference in new issue
Block a user