From 08ad0ca92fa58efcfe9d22b5f98bccb8ffc68ff6 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Thu, 27 Nov 2025 21:03:23 +0000 Subject: [PATCH] Update audible/audible.js --- audible/audible.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/audible/audible.js b/audible/audible.js index c822693..a9ab5bf 100644 --- a/audible/audible.js +++ b/audible/audible.js @@ -25,8 +25,20 @@ async function searchResults(keyword) { if (data.books && Array.isArray(data.books)) { foundBooks = true; for (const book of data.books) { + let title = book.title || "Untitled"; + title = title.replace(/\s+free\s+online\s*$/i, '') + .replace(/\s+audiobook\s+free\s+online\s*$/i, '') + .replace(/\s+audiobook\s+free\s*$/i, '') + .replace(/\s+free\s+audiobook\s*$/i, '') + .replace(/\s+free\s*$/i, '') + .replace(/\s+\(free\s*\)\s*$/i, '') + .replace(/\s+free\s+read\s+/i, ' read ') + .replace(/\s+\(.*?free.*?\)\s*$/i, '') + .replace(/\s+audiobook\s*$/i, '') + .trim(); + results.push({ - title: book.title || "Untitled", + title: title, image: book.image || "", href: "https://mapple.site/listen/" + (book.$id || "") + "/" + encodeURIComponent(book.title || "untitled") });