Version Check
Only assume old version on status code 404, raise communication error for all other codes
This commit is contained in:
parent
54ae6b062f
commit
4d6443effc
1 changed files with 5 additions and 1 deletions
|
@ -267,8 +267,12 @@ def fetchServerVersion() -> dict:
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
version = r.json()
|
version = r.json()
|
||||||
logging.info("Detected Immich server version %s.%s.%s", version['major'], version['minor'], version['patch'])
|
logging.info("Detected Immich server version %s.%s.%s", version['major'], version['minor'], version['patch'])
|
||||||
else:
|
# Since the API call did not exist prior to 1.106.1, we assume that 404 means we found an old version.
|
||||||
|
elif r.status_code == 404:
|
||||||
logging.info("Detected Immich server version %s.%s.%s or older", version['major'], version['minor'], version['patch'])
|
logging.info("Detected Immich server version %s.%s.%s or older", version['major'], version['minor'], version['patch'])
|
||||||
|
# Any other errors mean communication error with API
|
||||||
|
else:
|
||||||
|
r.raise_for_status()
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue