ImmichI
Immich4mo ago
crashmit

CLI finds images in Hashing, but looses them for upload

Hi there, I'm trying to create a small script that among others, uploads images from a folder to immich. The curious issue is that it detects the images for hashing and dupe check, but in the next steps, it says "Found 0 new files and 0 duplicates. Does anyone have an idea about the issue?

CLI output
$ immich upload . -r --delete
Crawling for assets...
Hashing files           | ████████████████████████████████████████ | 100% | ETA: 0s | 26/26 assets
Checking for duplicates | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 0% | ETA: 0s | 0/26 assets
Found 0 new files and 0 duplicates
All assets were already uploaded, nothing to do.
Deleting assets that have been uploaded...
Deleting local assets | ████████████████████████████████████████ | 100% | ETA: 0s | 0/0 assets

My python script
def upload_photos():
    # Login to Immich
    cmd = [
        "immich", "login", IMMICH_API_URL, IMMICH_API_KEY
    ]
    output = subprocess.run(cmd, capture_output=True, text=True, check=True)
    print(output.stdout)

    # Upload photos
    cmd = [
        "immich", "upload", PHOTO_DIR, "-r", "--delete"
    ]
    output = subprocess.run(cmd, capture_output=True, text=True, check=True)
    print(output.stdout)
Was this page helpful?