Skip to content

fix: don't delete requests when removing media from arr#3288

Open
fallenbagel wants to merge 1 commit into
fix/delete-media-already-removed-in-arrfrom
fix/remove-from-arr-keep-request
Open

fix: don't delete requests when removing media from arr#3288
fallenbagel wants to merge 1 commit into
fix/delete-media-already-removed-in-arrfrom
fix/remove-from-arr-keep-request

Conversation

@fallenbagel

@fallenbagel fallenbagel commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Important

Stacked on #3209, targets fix/delete-media-already-removed-in-arr temporarily meaning #3209 needs to be merged first

Remove from {arr}, in both ManageSlideOver and the request list, was calling the same delete-media endpoint Clear Data uses, so pressing it hard-deleted the whole media record and cascaded to remove any requests tied to it. Clear Data's own confirmation copy is explicit about that ("including any requests") and remove from {arr} has no such warning and isn't supposed to do that.

The file-delete route now marks the media (and each season, for TV) DELETED for the affected service and resets only that service's linkage fields, instead of deleting anything. MediaSubscriber already
completes the related request(s) when a media's status flips to DELETED, the same mechanism availability sync relies on when content disappears from Plex/Jellyfin/Emby. Re-requesting afterward works the same way it already does for anything availability sync marks deleted.

Clear Data keeps its current behavior unchanged.

How Has This Been Tested?

  • Should just work

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Copilot AI review requested due to automatic review settings July 24, 2026 02:36
@fallenbagel
fallenbagel requested a review from a team as a code owner July 24, 2026 02:36
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa293c86-9409-4b13-99d5-cba14d779139

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the “Remove from *arr” behavior so it no longer hard-deletes the Media entity (and cascading MediaRequests) when removing items from Radarr/Sonarr. Instead, the server marks the media (and TV seasons) as DELETED for the selected quality and clears only that quality’s service linkage fields, relying on existing subscriber logic to complete related requests.

Changes:

  • Frontend: stop calling DELETE /api/v1/media/:id as part of the “remove from *arr” flow in both the Request List item and ManageSlideOver.
  • Backend: update DELETE /api/v1/media/:id/file to set Media.status/status4k (and TV seasons) to DELETED, reset service linkage for the affected quality, and persist the updated entity.
  • Backend: extend Media.resetServiceData to support resetting non-4K only, 4K only, or both.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/components/RequestList/RequestItem/index.tsx Removes the hard-delete call so “remove from *arr” no longer deletes the media record and its requests.
src/components/ManageSlideOver/index.tsx Removes the hard-delete call for the same “remove from *arr” action in the slideover UI.
server/routes/media.ts Makes /media/:id/file mark media/seasons as DELETED and clear service linkage instead of deleting the media entity.
server/entity/Media.ts Updates resetServiceData to optionally reset only 4K or non-4K linkage fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fallenbagel
fallenbagel force-pushed the fix/remove-from-arr-keep-request branch from e87ef36 to f2dcde9 Compare July 24, 2026 03:07
@fallenbagel
fallenbagel force-pushed the fix/delete-media-already-removed-in-arr branch from 6340ac3 to ea02233 Compare July 24, 2026 03:09
@github-actions github-actions Bot added the merge conflict Cannot merge due to merge conflicts label Jul 24, 2026
@github-actions

This comment was marked as resolved.

Remove from {arr} called the same delete-media endpoint as Clear Data uses, which cascades and
removes every associated request. Mark the media (and season, forTV) DELETED and reset only the
affected service's linkage instead. MediaSubscriber already completes the related request(s) when
status flips to DELETED, the same path which availability sync uses when content disappears from
Plex/Jellyfin?emby. Clear data remains as the atcual hard-delete action.
Copilot AI review requested due to automatic review settings July 24, 2026 03:10
@fallenbagel
fallenbagel force-pushed the fix/remove-from-arr-keep-request branch from f2dcde9 to 82e0b70 Compare July 24, 2026 03:10
@github-actions github-actions Bot removed the merge conflict Cannot merge due to merge conflicts label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants