fix sidecar handling
This commit is contained in:
13
README.md
13
README.md
@@ -182,6 +182,17 @@ In the Immich web UI, go to Settings and find **API Keys** (menu labels can vary
|
||||
* `asset.view` — required for the viewAsset endpoint (thumbnail/preview/fullsize).
|
||||
* `asset.download` — required if you set `size` to `original` (download endpoint).
|
||||
|
||||
#### Finding an Immich user ID
|
||||
|
||||
You can use a user ID to show all assets owned by that user.
|
||||
|
||||
Common ways to find it:
|
||||
* **Admin UI**: In Immich, open the Admin/Users page, click the user, and copy the UUID shown in the user details or URL.
|
||||
* **API (non-admin)**: Call the `users/me` endpoint with the API key and read the `id` field:
|
||||
```
|
||||
curl -H "x-api-key: IMMICH_API_KEY" http://immich.local:2283/api/users/me
|
||||
```
|
||||
|
||||
Example (single source):
|
||||
```
|
||||
{
|
||||
@@ -222,7 +233,7 @@ Example (scheduler entry):
|
||||
Immich settings:
|
||||
* `url`: base Immich server URL (the integration appends `/api` automatically if missing).
|
||||
* `apiKey`: Immich API key (needs `asset.view`, and `asset.download` if `size` is `original`).
|
||||
* `userId`: optional user id to retrieve all assets owned by that user via the assets endpoint.
|
||||
* `userId`: optional user id to retrieve all assets owned by that user via the assets endpoint (see “Finding an Immich user ID” above).
|
||||
* `albumId` or `albumIds`: optional album filters.
|
||||
* `personId` or `personIds`: optional person filters.
|
||||
* `extensions` / `allowedExtensions`: optional list of file extensions to include (for example `["jpg","jpeg","png"]`).
|
||||
|
||||
@@ -108,7 +108,7 @@ slide_mqtt_set_album:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "album:{{ states('input_text.slide_album_id') }}"
|
||||
payload: "album:{{ states('input_text.slide_album_id') }}"
|
||||
|
||||
slide_mqtt_set_person:
|
||||
alias: Slide Set Person
|
||||
@@ -116,7 +116,7 @@ slide_mqtt_set_person:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "person:{{ states('input_text.slide_person_id') }}"
|
||||
payload: "person:{{ states('input_text.slide_person_id') }}"
|
||||
|
||||
slide_mqtt_set_user:
|
||||
alias: Slide Set User
|
||||
@@ -124,7 +124,7 @@ slide_mqtt_set_user:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "user:{{ states('input_text.slide_user_id') }}"
|
||||
payload: "user:{{ states('input_text.slide_user_id') }}"
|
||||
|
||||
slide_mqtt_set_extensions:
|
||||
alias: Slide Set Extensions
|
||||
@@ -132,7 +132,7 @@ slide_mqtt_set_extensions:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "extensions:{{ states('input_text.slide_extensions') }}"
|
||||
payload: "extensions:{{ states('input_text.slide_extensions') }}"
|
||||
|
||||
slide_mqtt_set_refresh:
|
||||
alias: Slide Set Refresh Seconds
|
||||
@@ -140,7 +140,7 @@ slide_mqtt_set_refresh:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "refreshSeconds:{{ states('input_text.slide_refresh_seconds') }}"
|
||||
payload: "refreshSeconds:{{ states('input_text.slide_refresh_seconds') }}"
|
||||
|
||||
slide_mqtt_set_size:
|
||||
alias: Slide Set Size
|
||||
@@ -148,7 +148,7 @@ slide_mqtt_set_size:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "size:{{ states('input_select.slide_size') }}"
|
||||
payload: "size:{{ states('input_select.slide_size') }}"
|
||||
|
||||
slide_mqtt_set_order:
|
||||
alias: Slide Set Order
|
||||
@@ -156,7 +156,7 @@ slide_mqtt_set_order:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: slide/immich
|
||||
payload_template: "order:{{ states('input_select.slide_order') }}"
|
||||
payload: "order:{{ states('input_select.slide_order') }}"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -411,12 +411,20 @@ QString ImmichAssetCache::findExisting(const QString &assetId) const
|
||||
QStringList matches = dir.entryList(QStringList() << (assetId + "_*"), QDir::Files, QDir::Time);
|
||||
if (matches.isEmpty())
|
||||
return "";
|
||||
QString skipFile;
|
||||
for (const auto &match : matches)
|
||||
{
|
||||
if (match.endsWith(".skip"))
|
||||
return dir.filePath(match);
|
||||
{
|
||||
if (skipFile.isEmpty())
|
||||
skipFile = dir.filePath(match);
|
||||
continue;
|
||||
}
|
||||
if (match.endsWith(".exif"))
|
||||
continue;
|
||||
return dir.filePath(match);
|
||||
}
|
||||
return dir.filePath(matches.first());
|
||||
return skipFile;
|
||||
}
|
||||
|
||||
QString ImmichAssetCache::sanitizeFileName(const QString &name) const
|
||||
|
||||
@@ -83,6 +83,8 @@ void ImmichPathTraverser::writeExifSidecar(const QString &imagePath, const QStri
|
||||
{
|
||||
if (imagePath.isEmpty() || dateTime.isEmpty())
|
||||
return;
|
||||
if (imagePath.endsWith(".exif") || imagePath.endsWith(".skip"))
|
||||
return;
|
||||
|
||||
QString sidecarPath = imagePath + ".exif";
|
||||
QFileInfo info(sidecarPath);
|
||||
|
||||
Reference in New Issue
Block a user