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.view` — required for the viewAsset endpoint (thumbnail/preview/fullsize).
|
||||||
* `asset.download` — required if you set `size` to `original` (download endpoint).
|
* `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):
|
Example (single source):
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
@@ -222,7 +233,7 @@ Example (scheduler entry):
|
|||||||
Immich settings:
|
Immich settings:
|
||||||
* `url`: base Immich server URL (the integration appends `/api` automatically if missing).
|
* `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`).
|
* `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.
|
* `albumId` or `albumIds`: optional album filters.
|
||||||
* `personId` or `personIds`: optional person filters.
|
* `personId` or `personIds`: optional person filters.
|
||||||
* `extensions` / `allowedExtensions`: optional list of file extensions to include (for example `["jpg","jpeg","png"]`).
|
* `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
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "album:{{ states('input_text.slide_album_id') }}"
|
payload: "album:{{ states('input_text.slide_album_id') }}"
|
||||||
|
|
||||||
slide_mqtt_set_person:
|
slide_mqtt_set_person:
|
||||||
alias: Slide Set Person
|
alias: Slide Set Person
|
||||||
@@ -116,7 +116,7 @@ slide_mqtt_set_person:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "person:{{ states('input_text.slide_person_id') }}"
|
payload: "person:{{ states('input_text.slide_person_id') }}"
|
||||||
|
|
||||||
slide_mqtt_set_user:
|
slide_mqtt_set_user:
|
||||||
alias: Slide Set User
|
alias: Slide Set User
|
||||||
@@ -124,7 +124,7 @@ slide_mqtt_set_user:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "user:{{ states('input_text.slide_user_id') }}"
|
payload: "user:{{ states('input_text.slide_user_id') }}"
|
||||||
|
|
||||||
slide_mqtt_set_extensions:
|
slide_mqtt_set_extensions:
|
||||||
alias: Slide Set Extensions
|
alias: Slide Set Extensions
|
||||||
@@ -132,7 +132,7 @@ slide_mqtt_set_extensions:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "extensions:{{ states('input_text.slide_extensions') }}"
|
payload: "extensions:{{ states('input_text.slide_extensions') }}"
|
||||||
|
|
||||||
slide_mqtt_set_refresh:
|
slide_mqtt_set_refresh:
|
||||||
alias: Slide Set Refresh Seconds
|
alias: Slide Set Refresh Seconds
|
||||||
@@ -140,7 +140,7 @@ slide_mqtt_set_refresh:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "refreshSeconds:{{ states('input_text.slide_refresh_seconds') }}"
|
payload: "refreshSeconds:{{ states('input_text.slide_refresh_seconds') }}"
|
||||||
|
|
||||||
slide_mqtt_set_size:
|
slide_mqtt_set_size:
|
||||||
alias: Slide Set Size
|
alias: Slide Set Size
|
||||||
@@ -148,7 +148,7 @@ slide_mqtt_set_size:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
topic: slide/immich
|
||||||
payload_template: "size:{{ states('input_select.slide_size') }}"
|
payload: "size:{{ states('input_select.slide_size') }}"
|
||||||
|
|
||||||
slide_mqtt_set_order:
|
slide_mqtt_set_order:
|
||||||
alias: Slide Set Order
|
alias: Slide Set Order
|
||||||
@@ -156,7 +156,7 @@ slide_mqtt_set_order:
|
|||||||
- service: mqtt.publish
|
- service: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: slide/immich
|
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);
|
QStringList matches = dir.entryList(QStringList() << (assetId + "_*"), QDir::Files, QDir::Time);
|
||||||
if (matches.isEmpty())
|
if (matches.isEmpty())
|
||||||
return "";
|
return "";
|
||||||
|
QString skipFile;
|
||||||
for (const auto &match : matches)
|
for (const auto &match : matches)
|
||||||
{
|
{
|
||||||
if (match.endsWith(".skip"))
|
if (match.endsWith(".skip"))
|
||||||
|
{
|
||||||
|
if (skipFile.isEmpty())
|
||||||
|
skipFile = dir.filePath(match);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (match.endsWith(".exif"))
|
||||||
|
continue;
|
||||||
return dir.filePath(match);
|
return dir.filePath(match);
|
||||||
}
|
}
|
||||||
return dir.filePath(matches.first());
|
return skipFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ImmichAssetCache::sanitizeFileName(const QString &name) const
|
QString ImmichAssetCache::sanitizeFileName(const QString &name) const
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ void ImmichPathTraverser::writeExifSidecar(const QString &imagePath, const QStri
|
|||||||
{
|
{
|
||||||
if (imagePath.isEmpty() || dateTime.isEmpty())
|
if (imagePath.isEmpty() || dateTime.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
if (imagePath.endsWith(".exif") || imagePath.endsWith(".skip"))
|
||||||
|
return;
|
||||||
|
|
||||||
QString sidecarPath = imagePath + ".exif";
|
QString sidecarPath = imagePath + ".exif";
|
||||||
QFileInfo info(sidecarPath);
|
QFileInfo info(sidecarPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user