From 7f2d41d24ba29296981ecc08aef6baa7fc53f82c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Jul 2026 21:34:12 +0300 Subject: 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 --- scripts/immich-upload | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/immich-upload') 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 -- cgit v1.2.3