fixes empty api search results (#115)

pull/117/head v0.7.4
Miguel Sozinho Ramalho 2023-12-13 10:51:25 +00:00 zatwierdzone przez GitHub
rodzic 98fb574d89
commit 128d4136e3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -40,11 +40,12 @@ class AAApiDb(Database):
response = requests.get(os.path.join(self.api_endpoint, "tasks/search-url"), params=params, headers=headers)
if response.status_code == 200:
logger.success(f"API returned a previously archived instance: {response.json()}")
# TODO: can we do better than just returning the most recent result?
return Metadata.from_dict(response.json()[0]["result"])
logger.error(f"AA API FAIL ({response.status_code}): {response.json()}")
if len(response.json()):
logger.success(f"API returned a previously archived instance: {response.json()}")
# TODO: can we do better than just returning the most recent result?
return Metadata.from_dict(response.json()[0]["result"])
else:
logger.error(f"AA API FAIL ({response.status_code}): {response.json()}")
return False

Wyświetl plik

@ -3,7 +3,7 @@ _MAJOR = "0"
_MINOR = "7"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "3"
_PATCH = "4"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""