Skip to content

fix: send isFavorite as boolean in JSON body for Immich 3.x compatibility - #31

Open
Infineon12 wants to merge 1 commit into
outadoc:mainfrom
Infineon12:patch-1
Open

fix: send isFavorite as boolean in JSON body for Immich 3.x compatibility#31
Infineon12 wants to merge 1 commit into
outadoc:mainfrom
Infineon12:patch-1

Conversation

@Infineon12

Copy link
Copy Markdown

Problem

After upgrading Immich to 3.x, the integration fails to load favorite images:

Error from API: body={"message":"Validation failed","errors":[{"expected":"boolean","code":"invalid_type","path":["isFavorite"],"message":"Invalid input: expected boolean, received string"}]}

Root Cause

list_favorite_images() in hub.py was sending the request body using data=, which causes aiohttp to serialize all values as strings. Immich 3.x now strictly validates that isFavorite is a boolean.

Fix

  • Changed data= to json= so the body is sent as JSON
  • Changed the variable name from json to payload to avoid shadowing the built-in module
  • Changed "true" (string) to True (boolean)

Fixes #30

@Matikitorch

Copy link
Copy Markdown

Can this please be merged? I believe the integration is completely broken with the latest Immich.

@Infineon12

Copy link
Copy Markdown
Author

So I think I can't do anything, needs to be done by a maintainer.
But at least I can tell you that my gallery is working without any issues with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isFavorite sent as string instead of boolean, breaks with Immich 3.x

2 participants