Compare commits

...

1 Commits

Author SHA1 Message Date
Miguel Sozinho Ramalho
128d4136e3 fixes empty api search results (#115) 2023-12-13 10:51:25 +00:00
2 changed files with 7 additions and 6 deletions

View File

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

View File

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