From adbcf803332f6d1c4da04c9f2bbbcf7068e7921d Mon Sep 17 00:00:00 2001 From: Someone <10882916+InterN0te@users.noreply.github.com> Date: Wed, 7 Jan 2026 17:06:11 +0100 Subject: [PATCH] fix(ui): remove duplicate download items in manage slide over (#1916) * fix(ui): filter duplicate downloads in ManageSlideOver using downloadId Apply the same logic as PR #927 to deduplicate season pack downloads in the "Manage Series" slide-over panel. * Update src/components/ManageSlideOver/index.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/components/ManageSlideOver/index.tsx Co-authored-by: Gauthier --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gauthier --- src/components/ManageSlideOver/index.tsx | 56 +++++++++++++++--------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/src/components/ManageSlideOver/index.tsx b/src/components/ManageSlideOver/index.tsx index 7a2c1047..a07df048 100644 --- a/src/components/ManageSlideOver/index.tsx +++ b/src/components/ManageSlideOver/index.tsx @@ -25,6 +25,7 @@ import { } from '@server/constants/media'; import { MediaServerType } from '@server/constants/server'; import type { MediaWatchDataResponse } from '@server/interfaces/api/mediaInterfaces'; +import type { DownloadingItem } from '@server/lib/downloadtracker'; import type { RadarrSettings, SonarrSettings } from '@server/lib/settings'; import type { MovieDetails } from '@server/models/Movie'; import type { TvDetails } from '@server/models/Tv'; @@ -33,6 +34,17 @@ import Link from 'next/link'; import { useIntl } from 'react-intl'; import useSWR from 'swr'; +const filterDuplicateDownloads = ( + items: DownloadingItem[] = [] +): DownloadingItem[] => { + const seen = new Set(); + return items.filter((item) => { + if (seen.has(item.downloadId)) return false; + seen.add(item.downloadId); + return true; + }); +}; + const messages = defineMessages('components.ManageSlideOver', { manageModalTitle: 'Manage {mediaType}', manageModalIssues: 'Open Issues', @@ -230,26 +242,30 @@ const ManageSlideOver = ({
    - {data.mediaInfo?.downloadStatus?.map((status, index) => ( - -
  • - -
  • -
    - ))} - {data.mediaInfo?.downloadStatus4k?.map((status, index) => ( - -
  • - -
  • -
    - ))} + {filterDuplicateDownloads(data.mediaInfo?.downloadStatus).map( + (status, index) => ( + +
  • + +
  • +
    + ) + )} + {filterDuplicateDownloads(data.mediaInfo?.downloadStatus4k).map( + (status, index) => ( + +
  • + +
  • +
    + ) + )}