From ce23d2c992947e3afd34b11869ea008f9d28ddd3 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 16 Dec 2019 18:19:06 -0400 Subject: [PATCH] Reactivate EventFile for video and audio events Temporary solution until the media player is ready --- TODO.md | 1 + src/qml/Chat/Timeline/EventMediaLoader.qml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index fc644007..9e474ba5 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,7 @@ # TODO - strip file:// from copy path +- some way to show name and date on EventFile - sentinel func to report path if already cached without having to click - verify eventfile height diff --git a/src/qml/Chat/Timeline/EventMediaLoader.qml b/src/qml/Chat/Timeline/EventMediaLoader.qml index d54e6858..6e83cc31 100644 --- a/src/qml/Chat/Timeline/EventMediaLoader.qml +++ b/src/qml/Chat/Timeline/EventMediaLoader.qml @@ -10,7 +10,7 @@ HLoader { if (type === EventDelegate.Media.Image) { var file = "EventImage.qml" - } else if (type === EventDelegate.Media.File) { + } else if (type !== EventDelegate.Media.Page) { var file = "EventFile.qml" } else { return } @@ -71,6 +71,11 @@ HLoader { function download(callback) { + if (! loader.mediaUrl.startsWith("mxc://")) { + downloadedPath = loader.mediaUrl + callback(loader.mediaUrl) + } + if (! downloadedPath) print("Downloading " + loader.mediaUrl + " ...") const args = [loader.mediaUrl, loader.singleMediaInfo.media_crypt_dict]