From 4f413c673e7700ce299d380ab9214b7495a7055b Mon Sep 17 00:00:00 2001 From: Marwin Schulz Date: Fri, 20 Mar 2026 09:18:38 +0100 Subject: [PATCH] Add 'Refresh all' button to podcast toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows live progress counter (↻ 3/42) while fetching feeds sequentially, then reloads the current view when done. Co-Authored-By: Claude Sonnet 4.6 --- static/js/app.js | 21 +++++++++++++++++++++ templates/radio/player.html | 1 + 2 files changed, 22 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index 6b065d0..23dbcf1 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1939,6 +1939,27 @@ async function refreshOpenFeed(btn) { if (btn) { btn.disabled = false; btn.textContent = '↻ Refresh'; } } +async function refreshAllFeedsBtn(btn) { + if (btn) { btn.disabled = true; btn.textContent = '↻ 0/' + podcastFeeds.length; } + let done = 0; + for (const feed of podcastFeeds) { + try { + await fetch('/podcasts/feeds/refresh/', { + method: 'POST', + headers: {'Content-Type': 'application/json', 'X-CSRFToken': getCsrfToken()}, + body: JSON.stringify({feed_id: feed.id}), + }); + } catch (e) {} + done++; + if (btn) btn.textContent = `↻ ${done}/${podcastFeeds.length}`; + } + await loadFeedList(); + if (podcastCurrentView === 'feeds') renderFeedList(); + if (podcastCurrentView === 'inbox') loadAndRenderInbox(); + if (podcastCurrentView === 'episodes' && podcastCurrentFeedId) openFeed(podcastCurrentFeedId); + if (btn) { btn.disabled = false; btn.textContent = '↻ All'; } +} + async function refreshAllFeeds() { if (!IS_AUTHENTICATED || !podcastFeeds.length) return; for (const feed of podcastFeeds) { diff --git a/templates/radio/player.html b/templates/radio/player.html index ea40992..099a52d 100644 --- a/templates/radio/player.html +++ b/templates/radio/player.html @@ -231,6 +231,7 @@ +