Skip to content

Exception when deleting already deleted file from Radarr #3112

Description

@cardoso42

Description

After deleting a movie directly on Radarr, it becomes impossible to delete it on Seerr.

Version

3.2.0

Steps to Reproduce

  1. Delete a movie file on Radarr
  2. Open the movie details screen on Seerr
  3. Click to delete it
  4. Click on "Are you sure?"

Screenshots

Image

Logs

Uncaught (in promise) AxiosError: Request failed with status code 404

Platform

desktop

Database

SQLite (default)

Device

ASUS Vivobook

Operating System

Pop!_OS 22.04 LTS

Browser

Mozilla Firefox 149.0

Additional Context

I've read some of the code and it seems that this function is the responsible:

  const deleteMediaFile = async (is4k = false) => {
    if (data.mediaInfo) {
      await axios.delete(
        `/api/v1/media/${data.mediaInfo.id}/file?is4k=${is4k}`
      );
      await axios.delete(`/api/v1/media/${data.mediaInfo.id}`);
      revalidate();
      onClose();
    }
  };

As axios throws an error when the DELETE request returns with a status code of 404, it simply never marks the movie as deleted. Since a 404 on a DELETE means the resource is already gone, it should be treated as a success. I'd suggest catching 404s and continuing with revalidate() and onClose() as normal, since the desired end state (resource no longer exists) is already achieved.

Search Existing Issues

  • Yes, I have searched existing issues.

Code of Conduct

  • I agree to follow Seerr's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageThis issue needs to be reviewed

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions