fixing older db entries formats (#114)

pull/115/head v0.7.3
Miguel Sozinho Ramalho 2023-12-12 22:47:54 +00:00 zatwierdzone przez GitHub
rodzic 6f36e92e02
commit 98fb574d89
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -65,7 +65,9 @@ class Media:
@property # getter .mimetype
def mimetype(self) -> str:
assert self.filename is not None and len(self.filename) > 0, "cannot get mimetype from media without filename"
if not self.filename or len(self.filename) == 0:
logger.warning(f"cannot get mimetype from media without filename: {self}")
return ""
if not self._mimetype:
self._mimetype = mimetypes.guess_type(self.filename)[0]
return self._mimetype or ""

Wyświetl plik

@ -41,7 +41,7 @@ class AAApiDb(Database):
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 first 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()}")

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 = "2"
_PATCH = "3"
# 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 = ""