From b558dff1380b78b908b72a9135cacd864c8fa13c Mon Sep 17 00:00:00 2001
From: Broque Thomas <26755000+Nezreka@users.noreply.github.com>
Date: Mon, 2 Mar 2026 09:24:37 -0800
Subject: [PATCH] add all recommended to watchlist.
---
webui/static/mobile.css | 11 ++++++--
webui/static/script.js | 62 +++++++++++++++++++++++++++++++++++++----
webui/static/style.css | 42 ++++++++++++++++++++++++++--
3 files changed, 105 insertions(+), 10 deletions(-)
diff --git a/webui/static/mobile.css b/webui/static/mobile.css
index a640f5d1..d81707c9 100644
--- a/webui/static/mobile.css
+++ b/webui/static/mobile.css
@@ -939,8 +939,15 @@
padding: 12px 16px;
}
- .recommended-search-container {
- padding: 0 16px;
+ .recommended-actions-bar {
+ padding: 12px 16px 0;
+ flex-wrap: wrap;
+ }
+
+ .recommended-add-all-btn {
+ width: 100%;
+ text-align: center;
+ padding: 10px;
}
.recommended-card-watchlist-btn {
diff --git a/webui/static/script.js b/webui/static/script.js
index 398ff7dd..86717e0c 100644
--- a/webui/static/script.js
+++ b/webui/static/script.js
@@ -33742,12 +33742,18 @@ function renderRecommendedArtistsModal(modal, artists) {
×
-
-
+
+
+
+
+
${artists.map(artist => {
@@ -33811,6 +33817,50 @@ function renderRecommendedArtistsModal(modal, artists) {
}
}
+async function addAllRecommendedToWatchlist(btn) {
+ if (!_recommendedArtistsCache || _recommendedArtistsCache.length === 0) return;
+ if (btn.classList.contains('all-added')) return;
+
+ const originalText = btn.textContent;
+ btn.disabled = true;
+ btn.textContent = 'Adding...';
+
+ try {
+ const artists = _recommendedArtistsCache.map(a => ({
+ artist_id: a.artist_id,
+ artist_name: a.artist_name
+ }));
+
+ const resp = await fetch('/api/watchlist/add-batch', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ artists })
+ });
+ const data = await resp.json();
+
+ if (data.success) {
+ btn.textContent = `All Added (${data.added} new)`;
+ btn.classList.add('all-added');
+ btn.disabled = true;
+
+ // Update all watchlist buttons in the modal to "Watching"
+ document.querySelectorAll('.recommended-card-watchlist-btn').forEach(wBtn => {
+ wBtn.classList.add('watching');
+ wBtn.textContent = 'Watching';
+ });
+
+ if (typeof updateWatchlistButtonCount === 'function') updateWatchlistButtonCount();
+ } else {
+ btn.textContent = originalText;
+ btn.disabled = false;
+ }
+ } catch (error) {
+ console.error('Error adding all recommended to watchlist:', error);
+ btn.textContent = originalText;
+ btn.disabled = false;
+ }
+}
+
function closeRecommendedArtistsModal() {
const modal = document.getElementById('recommended-artists-modal');
if (modal) modal.style.display = 'none';
diff --git a/webui/static/style.css b/webui/static/style.css
index 5aeea09f..ee4f01c0 100644
--- a/webui/static/style.css
+++ b/webui/static/style.css
@@ -20352,11 +20352,49 @@ body {
opacity: 1;
}
-.recommended-search-container {
- padding: 0 28px;
+.recommended-actions-bar {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 16px 28px 0;
margin-bottom: 12px;
}
+.recommended-search-container {
+ flex: 1;
+}
+
+.recommended-add-all-btn {
+ flex-shrink: 0;
+ padding: 10px 20px;
+ border-radius: 10px;
+ border: 1px solid rgba(var(--accent-rgb), 0.3);
+ background: rgba(var(--accent-rgb), 0.1);
+ color: rgb(var(--accent-rgb));
+ font-size: 13px;
+ font-weight: 600;
+ cursor: pointer;
+ white-space: nowrap;
+ transition: background 0.2s ease, border-color 0.2s ease;
+}
+
+.recommended-add-all-btn:hover {
+ background: rgba(var(--accent-rgb), 0.2);
+ border-color: rgba(var(--accent-rgb), 0.5);
+}
+
+.recommended-add-all-btn:disabled {
+ opacity: 0.5;
+ cursor: default;
+}
+
+.recommended-add-all-btn.all-added {
+ background: rgba(var(--accent-rgb), 0.08);
+ border-color: rgba(var(--accent-rgb), 0.2);
+ opacity: 0.7;
+ cursor: default;
+}
+
.recommended-search-input {
width: 100%;
padding: 10px 16px;