Add title property for EventMediaLoader

This commit is contained in:
miruka 2020-03-09 11:08:07 -04:00
parent 2a2b3df845
commit bd7b45cc7a
2 changed files with 9 additions and 2 deletions

View File

@ -28,6 +28,9 @@ HLoader {
property string downloadedPath: "" property string downloadedPath: ""
readonly property string title:
singleMediaInfo.media_title || utils.urlFileName(mediaUrl)
readonly property var imageExtensions: [ readonly property var imageExtensions: [
"bmp", "gif", "jpg", "jpeg", "png", "pbm", "pgm", "ppm", "xbm", "xpm", "bmp", "gif", "jpg", "jpeg", "png", "pbm", "pgm", "ppm", "xbm", "xpm",
"tiff", "webp", "svg", "tiff", "webp", "svg",

View File

@ -298,9 +298,13 @@ QtObject {
} }
function urlFileName(url) {
return url.toString().split("/").slice(-1)[0].split("?")[0]
}
function urlExtension(url) { function urlExtension(url) {
return url.toString().split("/").slice(-1)[0].split("?")[0].split(".") return urlFileName(url).split(".").slice(-1)[0]
.slice(-1)[0].toLowerCase()
} }