From b1fd61af3aae277b6cd8a11efeaba5a8a73a9282 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello <8296030+Piccirello@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:30:24 -0700 Subject: [PATCH] WebUI: Handle folders when updating RSS feed url Follow up to #21371 ([context](https://github.com/qbittorrent/qBittorrent/pull/21371#discussion_r1780908605)). PR #21437. --- src/webui/www/private/scripts/contextmenu.js | 5 +++++ src/webui/www/private/views/rss.html | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index 2b6891394..038a440b6 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -648,6 +648,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.hideItem("update"); this.hideItem("markRead"); this.hideItem("rename"); + this.hideItem("edit"); this.hideItem("delete"); this.showItem("newSubscription"); this.showItem("newFolder"); @@ -660,6 +661,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.showItem("update"); this.showItem("markRead"); this.hideItem("rename"); + this.hideItem("edit"); this.hideItem("delete"); this.showItem("newSubscription"); this.hideItem("newFolder"); @@ -671,6 +673,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.showItem("update"); this.showItem("markRead"); this.showItem("rename"); + this.hideItem("edit"); this.showItem("delete"); this.showItem("newSubscription"); this.showItem("newFolder"); @@ -682,6 +685,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.showItem("update"); this.showItem("markRead"); this.showItem("rename"); + this.showItem("edit"); this.showItem("delete"); this.showItem("newSubscription"); this.hideItem("newFolder"); @@ -694,6 +698,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.showItem("update"); this.showItem("markRead"); this.hideItem("rename"); + this.hideItem("edit"); this.showItem("delete"); this.hideItem("newSubscription"); this.hideItem("newFolder"); diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index 2c77959a7..3f0e57dc9 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -503,9 +503,15 @@ if ((rssFeedRows.length - 1) === flattenedResp.length) { match = true; for (let i = 0; i < flattenedResp.length; ++i) { - if (((flattenedResp[i].uid ? flattenedResp[i].uid : "") !== rssFeedRows[i + 1].full_data.dataUid) - || (flattenedResp[i].fullName !== rssFeedRows[i + 1].full_data.dataPath) - || (flattenedResp[i].url !== rssFeedRows[i + 1].full_data.dataUrl)) { + const newData = flattenedResp[i]; + const existingData = rssFeedRows[i + 1].full_data; + + if (newData.fullName !== existingData.dataPath) { + match = false; + break; + } + // only non-folders have these properties + if (!newData.isFolder && ((newData.uid !== existingData.dataUid) || (newData.url !== existingData.dataUrl))) { match = false; break; } -- 2.11.4.GIT