Strip file:// prefix from copied downloaded paths

This commit is contained in:
miruka 2019-12-16 18:22:25 -04:00
parent ce23d2c992
commit 1d43d522e6
4 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,5 @@
# TODO # TODO
- strip file:// from copy path
- some way to show name and date on EventFile - some way to show name and date on EventFile
- sentinel func to report path if already cached without having to click - sentinel func to report path if already cached without having to click
- verify eventfile height - verify eventfile height

View File

@ -30,7 +30,7 @@ HTile {
eventDelegate.hoveredMediaTypeUrl = [ eventDelegate.hoveredMediaTypeUrl = [
EventDelegate.Media.File, EventDelegate.Media.File,
loader.downloadedPath || loader.mediaUrl loader.downloadedPath.replace(/^file:\/\//, "") || loader.mediaUrl
] ]
} }

View File

@ -90,7 +90,8 @@ HMxcImage {
eventDelegate.hoveredMediaTypeUrl = [ eventDelegate.hoveredMediaTypeUrl = [
EventDelegate.Media.Image, EventDelegate.Media.Image,
loader.downloadedPath || loader.mediaUrl loader.downloadedPath.replace(/^file:\/\//, "") ||
loader.mediaUrl
] ]
} }
} }

View File

@ -74,6 +74,7 @@ HLoader {
if (! loader.mediaUrl.startsWith("mxc://")) { if (! loader.mediaUrl.startsWith("mxc://")) {
downloadedPath = loader.mediaUrl downloadedPath = loader.mediaUrl
callback(loader.mediaUrl) callback(loader.mediaUrl)
return
} }
if (! downloadedPath) print("Downloading " + loader.mediaUrl + " ...") if (! downloadedPath) print("Downloading " + loader.mediaUrl + " ...")