diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-18 21:34:12 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-18 21:34:12 +0300 |
| commit | 7f2d41d24ba29296981ecc08aef6baa7fc53f82c (patch) | |
| tree | 63d83ffe70e764f23e1b7a0c9549143b3f158b68 /scripts | |
| parent | 1fa1c36279f7e0bbfa73a5939e387019f44cd964 (diff) | |
immich-upload: drop deviceAssetId/deviceId fields for Immich 3.x
Immich 3.x removed the deviceAssetId/deviceId columns (migration
DropDeviceIdAndDeviceAssetId). The /api/assets endpoint still tolerates
but ignores them; removed for correctness/future-proofing. Duplicate
detection continues via the x-immich-checksum header and the
bulk-upload-check pre-pass (verified end-to-end against the live v3.0.3
server: 201 created, 200 duplicate).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/immich-upload | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/immich-upload b/scripts/immich-upload index a780730..7fe5bba 100755 --- a/scripts/immich-upload +++ b/scripts/immich-upload @@ -113,6 +113,12 @@ upload_file() { tmpfile=$(mktemp) trap "rm -f $tmpfile" RETURN + # Immich 3.x dropped the deviceAssetId/deviceId columns (migration + # DropDeviceIdAndDeviceAssetId). The /api/assets endpoint still tolerates + # those multipart fields but ignores them, so they are removed here to stay + # correct and future-proof. Duplicate detection is done server-side via the + # x-immich-checksum header (and the bulk-upload-check pre-pass), which + # returns HTTP 200 {"status":"duplicate"} instead of 201 {"status":"created"}. local http_code http_code=$(curl -s -o "$tmpfile" -w '%{http_code}' -X POST \ -H "x-api-key: $api_key" \ @@ -121,8 +127,6 @@ upload_file() { -F "fileCreatedAt=$fileCreatedAt" \ -F "fileModifiedAt=$fileModifiedAt" \ -F "filename=$filename" \ - -F "deviceAssetId=$checksum" \ - -F "deviceId=immich-upload-cli" \ "$IMMICH_URL/api/assets" 2>/dev/null) || { http_code="000"; } if [[ "$http_code" == "200" ]]; then |
