Upload thumbnails with the correct extension
This commit is contained in:
parent
2307d5f1b2
commit
382235875c
1
TODO.md
1
TODO.md
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## Before release
|
## Before release
|
||||||
|
|
||||||
|
- Downloaded media filenames
|
||||||
- "exception during sync" aren't caught
|
- "exception during sync" aren't caught
|
||||||
- nio ClientTimeout
|
- nio ClientTimeout
|
||||||
- Name
|
- Name
|
||||||
|
|
|
@ -446,7 +446,8 @@ class MatrixClient(nio.AsyncClient):
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
log.warning(f"Failed thumbnailing {path}: {err}")
|
log.warning(f"Failed thumbnailing {path}: {err}")
|
||||||
else:
|
else:
|
||||||
thumb_name = f"{path.stem}_thumbnail{''.join(path.suffixes)}"
|
thumb_ext = "png" if thumb_info.mime == "image/png" else "jpg"
|
||||||
|
thumb_name = f"{path.stem}_thumbnail.{thumb_ext}"
|
||||||
|
|
||||||
upload_item.status = UploadStatus.Uploading
|
upload_item.status = UploadStatus.Uploading
|
||||||
upload_item.filepath = Path(thumb_name)
|
upload_item.filepath = Path(thumb_name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user