add(metadata) search also for narrator if same title

This commit is contained in:
Steppenstreuner
2026-08-28 17:32:26 +02:00
parent 077b75bbb4
commit 9791469017
9 changed files with 64 additions and 4 deletions
+8 -2
View File
@@ -127,6 +127,7 @@ $("#search-form").addEventListener("submit", async (e) => {
<div class="card-body">
<strong>${esc(r.title)}</strong>
<span>${esc(r.authors)}</span>
${r.narrator ? `<span class="muted">🎙 ${esc(r.narrator)}</span>` : ""}
<span class="muted">${r.year ?? ""} ${r.external_id ? "· " + esc(r.external_id) : ""}</span>
${type === "comic" ? `<input type="number" min="0" placeholder="Band" class="volume" data-vol="${i}">` : ""}
<div class="row">
@@ -149,7 +150,8 @@ $("#search-form").addEventListener("submit", async (e) => {
method: "POST",
body: JSON.stringify({
library_id: parseInt(libId),
title: r.title, authors: r.authors, external_id: r.external_id,
title: r.title, authors: r.authors, narrator: r.narrator || "",
external_id: r.external_id,
year: r.year, series: r.series, cover_url: r.cover_url,
volume: volInput && volInput.value ? parseInt(volInput.value) : null,
}),
@@ -192,6 +194,7 @@ $("#manual-form").addEventListener("submit", async (e) => {
body: JSON.stringify({
library_id: parseInt(data.library_id),
series: data.series || data.title, authors: data.authors,
narrator: data.narrator || "",
volume_from: parseInt(data.volume),
volume_to: parseInt(data.volume_to),
year: data.year ? parseInt(data.year) : null,
@@ -204,6 +207,7 @@ $("#manual-form").addEventListener("submit", async (e) => {
body: JSON.stringify({
library_id: parseInt(data.library_id),
title: data.title, authors: data.authors, series: data.series,
narrator: data.narrator || "",
external_id: data.external_id,
year: data.year ? parseInt(data.year) : null,
volume: data.volume ? parseInt(data.volume) : null,
@@ -393,6 +397,7 @@ async function runQuickSearch() {
<div class="card-body">
<strong>${esc(r.title)}</strong>
<span>${esc(r.authors)}</span>
${r.narrator ? `<span class="muted">🎙 ${esc(r.narrator)}</span>` : ""}
<span class="muted">${r.year ?? ""}</span>
<div class="row"><button data-pick="${j}">Anfragen &amp; verbinden</button></div>
</div>
@@ -423,7 +428,8 @@ async function pickQuickResult(r) {
method: "POST",
body: JSON.stringify({
library_id: parseInt(libId),
title: r.title, authors: r.authors, external_id: r.external_id,
title: r.title, authors: r.authors, narrator: r.narrator || "",
external_id: r.external_id,
year: r.year, series: r.series, cover_url: r.cover_url,
}),
});
+3 -1
View File
@@ -46,6 +46,7 @@
</label>
<label>Titel <input name="title" required /></label>
<label>Autor(en) <input name="authors" /></label>
<label>Sprecher <input name="narrator" /></label>
<label>Serie <input name="series" /></label>
<label>Band <input name="volume" type="number" min="0" /></label>
<label
@@ -180,7 +181,8 @@
<button type="submit">Anlegen</button>
</form>
<p class="muted">
Platzhalter: {Author} {Authors} {Title} {Year} {Series} {Volume}
Platzhalter: {Author} {Authors} {Narrator} {Title} {Year} {Series}
{Volume}
</p>
</section>
</main>