Skip to content

Excluded external library files are still deleted when trash is emptied #14995

Description

@DracoC77

The bug

After creating some folders I meant to exclude from the Immich with a wildcard, I forgot to add the exclusion rule to the external library settings before scanning and realized I had accidentally imported files I didn't mean to.

I then added the exclusion rule and re-scanned my external libraries, and the files in the excluded folders were moved to the trash with the "assets no longer available" warning message... so far so good...

When I went to the trash to remove all of the dangling files that were in my excluded folder, I got worried that when I emptied the trash, it would still delete all of these files (instead of leaving the files in the external library folders alone). Sure enough, after emptying the trash on all the files that had the "assets no longer available" warnings, all of the files in those folders were deleted as well.

A bit of a corner case scenario, but may need to consider how to handle excluded directories AFTER a scan has aleady been done on those directories

The OS that Immich Server is running on

Docker in Unraid

Version of Immich Server

v1.121.0

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

n/a

Your .env content

n/a

Reproduction steps

  1. Scan an external library path with a folder meant for excluded files
  2. Add exclusion criteria for that folder
  3. Re-scan external library with new exclusion criteria
  4. Go to trash and empty trash on assets in the excluded folder
  5. (Check folder that immich as deleted the files in folder)
    ...

Relevant log output

No response

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions