WebUI: Handle folders when updating RSS feed url

Follow up to #21371 ([context](https://github.com/qbittorrent/qBittorrent/pull/21371#discussion_r1780908605)).

PR #21437.
This commit is contained in:
Thomas Piccirello 2024-10-11 22:30:24 -07:00 committed by GitHub
parent 2d185dc1c7
commit b1fd61af3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View file

@ -648,6 +648,7 @@ window.qBittorrent.ContextMenu ??= (() => {
this.hideItem("update"); this.hideItem("update");
this.hideItem("markRead"); this.hideItem("markRead");
this.hideItem("rename"); this.hideItem("rename");
this.hideItem("edit");
this.hideItem("delete"); this.hideItem("delete");
this.showItem("newSubscription"); this.showItem("newSubscription");
this.showItem("newFolder"); this.showItem("newFolder");
@ -660,6 +661,7 @@ window.qBittorrent.ContextMenu ??= (() => {
this.showItem("update"); this.showItem("update");
this.showItem("markRead"); this.showItem("markRead");
this.hideItem("rename"); this.hideItem("rename");
this.hideItem("edit");
this.hideItem("delete"); this.hideItem("delete");
this.showItem("newSubscription"); this.showItem("newSubscription");
this.hideItem("newFolder"); this.hideItem("newFolder");
@ -671,6 +673,7 @@ window.qBittorrent.ContextMenu ??= (() => {
this.showItem("update"); this.showItem("update");
this.showItem("markRead"); this.showItem("markRead");
this.showItem("rename"); this.showItem("rename");
this.hideItem("edit");
this.showItem("delete"); this.showItem("delete");
this.showItem("newSubscription"); this.showItem("newSubscription");
this.showItem("newFolder"); this.showItem("newFolder");
@ -682,6 +685,7 @@ window.qBittorrent.ContextMenu ??= (() => {
this.showItem("update"); this.showItem("update");
this.showItem("markRead"); this.showItem("markRead");
this.showItem("rename"); this.showItem("rename");
this.showItem("edit");
this.showItem("delete"); this.showItem("delete");
this.showItem("newSubscription"); this.showItem("newSubscription");
this.hideItem("newFolder"); this.hideItem("newFolder");
@ -694,6 +698,7 @@ window.qBittorrent.ContextMenu ??= (() => {
this.showItem("update"); this.showItem("update");
this.showItem("markRead"); this.showItem("markRead");
this.hideItem("rename"); this.hideItem("rename");
this.hideItem("edit");
this.showItem("delete"); this.showItem("delete");
this.hideItem("newSubscription"); this.hideItem("newSubscription");
this.hideItem("newFolder"); this.hideItem("newFolder");

View file

@ -503,9 +503,15 @@
if ((rssFeedRows.length - 1) === flattenedResp.length) { if ((rssFeedRows.length - 1) === flattenedResp.length) {
match = true; match = true;
for (let i = 0; i < flattenedResp.length; ++i) { for (let i = 0; i < flattenedResp.length; ++i) {
if (((flattenedResp[i].uid ? flattenedResp[i].uid : "") !== rssFeedRows[i + 1].full_data.dataUid) const newData = flattenedResp[i];
|| (flattenedResp[i].fullName !== rssFeedRows[i + 1].full_data.dataPath) const existingData = rssFeedRows[i + 1].full_data;
|| (flattenedResp[i].url !== rssFeedRows[i + 1].full_data.dataUrl)) {
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; match = false;
break; break;
} }