Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata Search: Option 'isOffline' is ignored #13161

Open
1 of 3 tasks
Salvoxia opened this issue Oct 3, 2024 · 1 comment
Open
1 of 3 tasks

Metadata Search: Option 'isOffline' is ignored #13161

Salvoxia opened this issue Oct 3, 2024 · 1 comment
Assignees

Comments

@Salvoxia
Copy link

Salvoxia commented Oct 3, 2024

The bug

The API Documentation for the searchMetadata endpoint specifies a search option isOffline.
My expectation is that this option can be used to find all assets that are currently marked as offline.
However, that option seems to be ignored entirely, yielding the same search results as if no search options were supplied.

I believe this option is simply forgotten in searchAssetBuilder function of the database utils.

The OS that Immich Server is running on

Debian 12 Bookworm

Version of Immich Server

v1.117.0

Version of Immich Mobile App

does not apply

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Does not apply

Your .env content

Does not apply

Reproduction steps

  1. Have an external library with at least one offline and one online asset in your Immich database
  2. Run the following cURL command
curl -L 'https://immich.mydomain.com/api/search/metadata' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-api-key: myapikey' \
-d '{
  "isOffline": true
}'
  1. The results contain assets with isOffline: false
  2. The results are identical to running the following command without any search options
curl -L 'https://immich.mydomain.com/api/search/metadata' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-api-key: myapikey' \
-d '{}'

Relevant log output

No response

Additional information

No response

@mertalev mertalev self-assigned this Oct 3, 2024
@Salvoxia
Copy link
Author

Salvoxia commented Dec 2, 2024

Following up on this. At the moment (v1.121.0) the metadata search seems to no longer include offline assets at all, nor does it include trashed assets (rendering the trashedAfter and trashedBefore filters useless).
My use case is to automate removal of offline assets, but only offline assets, not the entire trash.
The only way to get these assets at the moment seems using the timeline with isTrashed=true, but that seems to me abusing that API endpoint for something it was not built for.

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

No branches or pull requests

2 participants