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
- 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

View File

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

View File

@ -90,7 +90,8 @@ HMxcImage {
eventDelegate.hoveredMediaTypeUrl = [
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://")) {
downloadedPath = loader.mediaUrl
callback(loader.mediaUrl)
return
}
if (! downloadedPath) print("Downloading " + loader.mediaUrl + " ...")