fix: don't delete requests when removing media from arr#3288
fix: don't delete requests when removing media from arr#3288fallenbagel wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
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/:idas part of the “remove from *arr” flow in both the Request List item and ManageSlideOver. - Backend: update
DELETE /api/v1/media/:id/fileto setMedia.status/status4k(and TV seasons) toDELETED, reset service linkage for the affected quality, and persist the updated entity. - Backend: extend
Media.resetServiceDatato 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.
e87ef36 to
f2dcde9
Compare
6340ac3 to
ea02233
Compare
This comment was marked as resolved.
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.
f2dcde9 to
82e0b70
Compare
Description
Important
Stacked on #3209, targets
fix/delete-media-already-removed-in-arrtemporarily meaning #3209 needs to be merged firstRemove 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.
MediaSubscriberalreadycompletes 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?
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extract