Commit Graph

15 Commits

Author SHA1 Message Date
miruka
df3f1fb645 Remove all Backend "get_any_client"-using methods
thumbnail() and download() were remaining.
Use a direct and carefully chosen MatrixClient's methods instead to
avoid problems mentioned in the previous commit 7502c1.
2020-08-24 09:54:43 -04:00
miruka
55e22ea948 Add openMessagesLinksOrFilesExternally keybind
This required us to set the media downloaded local path on events
entirely from python instead of simply lazy-fetching them when needed
from QML, due to pyotherside's async nature and files that must be open
in a certain order.
2020-07-20 23:07:52 -04:00
miruka
30ce271ebc Real "copy URL" & "copy path" context menu entries
Replace the poorly implemented 2-in-1 "copy address" media event
menu option with:

- Copy <mediaType> address: visible for non-encrypted media, always
  copies the http URL

- Copy local path: always visible for already downloaded media, even if
  they were downloaded before mirage was started
2020-07-20 00:22:12 -04:00
miruka
f1055ce5b9 Fix loading m.image events in encrypted rooms
Fix bug introduced in 11fb32:

When loading an encrypted thumbnail, QML lacks the decryption dict for
half a second at first.

When calling python like this, python calls the wrong matrix API
for fetching the encrypted thumbnail, and the added retry code
would be forever stuck.

The retry code has been moved to QML, and now works for all HImage.
2020-07-19 14:49:41 -04:00
miruka
11fb32bff6 Retry downloading media if they fail with 404/500+
Trying to fetch a media right after it was uploaded can sometimes lead
to a  404
2020-07-18 22:26:23 -04:00
miruka
e4d47b9b9c Ensure we don't atomically write an empty file 2020-03-17 12:09:08 -04:00
miruka
190eb58187 Write user files and media atomically 2020-03-13 04:36:22 -04:00
miruka
77d877047b Update docstrings 2020-03-12 14:41:00 -04:00
miruka
f9f558cd34 Fix Thumbnail.from_bytes() 2020-03-09 17:33:07 -04:00
miruka
7ee83c5fe4 Downloaded files: include title + ext in filename 2020-03-09 11:46:08 -04:00
miruka
b992db9bfe Use typing.TYPE_CHECKING to avoid inner imports 2020-02-12 05:56:18 -04:00
miruka
fb1f9c62e5 Add SPDX ID LGPL v3+ license headers 2019-12-19 07:46:16 -04:00
miruka
1f41e2ffaa Document Backend attrs, adapt to new ModelStore 2019-12-18 16:24:43 -04:00
miruka
d9b27eff9f Document media_cache.py 2019-12-18 13:43:31 -04:00
miruka
2bdf21d528 Rename some filers and folder for clarity 2019-12-18 04:45:09 -04:00