I have a text file of ~1,000 "original file names" , and I need to transform this into a text file containing the Immich asset ID that corresponds to these. Unfortunately, immich-rest-cli search assets --original-file-name $FILENAME only lets me search for a single file name at a time, so this requires ~1,000 API requests.
But at the moment, each time I invoke immich-rest-cli, it takes multiple seconds to run. This is because it has to fetch & parse the spec, generate models, build the registry, etc... each time before it can dispatch my request.
This work is unnecessary, as the API spec only changes when the Immich server is updated.
The easiest way to solve this would be to cache the important data once it has been loaded & transformed. Even with a cache validity of just one hour would drastically speed up repeated calls.
A command should also be added to skip the cache and force a rebuild of the CLI.
I have a text file of ~1,000 "original file names" , and I need to transform this into a text file containing the Immich asset ID that corresponds to these. Unfortunately,
immich-rest-cli search assets --original-file-name $FILENAMEonly lets me search for a single file name at a time, so this requires ~1,000 API requests.But at the moment, each time I invoke
immich-rest-cli, it takes multiple seconds to run. This is because it has to fetch & parse the spec, generate models, build the registry, etc... each time before it can dispatch my request.This work is unnecessary, as the API spec only changes when the Immich server is updated.
The easiest way to solve this would be to cache the important data once it has been loaded & transformed. Even with a cache validity of just one hour would drastically speed up repeated calls.
A command should also be added to skip the cache and force a rebuild of the CLI.