Utils.urlExtension: don't lowercase returned ext

This commit is contained in:
miruka 2020-03-09 11:00:48 -04:00
parent ff642485e8
commit 2a2b3df845
4 changed files with 5 additions and 4 deletions

View File

@ -14,7 +14,8 @@ Image {
property bool broken: false property bool broken: false
property bool animate: true property bool animate: true
property bool animated: utils.urlExtension(image.source) === "gif" property bool animated:
utils.urlExtension(image.source).toLowerCase() === "gif"
property alias showProgressBar: progressBarLoader.active property alias showProgressBar: progressBarLoader.active
property bool inderterminateProgressBar: false property bool inderterminateProgressBar: false

View File

@ -10,7 +10,7 @@ HMxcImage {
horizontalAlignment: Image.AlignLeft horizontalAlignment: Image.AlignLeft
animated: loader.singleMediaInfo.media_mime === "image/gif" || animated: loader.singleMediaInfo.media_mime === "image/gif" ||
utils.urlExtension(loader.mediaUrl) === "gif" utils.urlExtension(loader.mediaUrl).toLowerCase() === "gif"
thumbnail: ! animated && loader.thumbnailMxc thumbnail: ! animated && loader.thumbnailMxc
mxc: thumbnail ? mxc: thumbnail ?
(loader.thumbnailMxc || loader.mediaUrl) : (loader.thumbnailMxc || loader.mediaUrl) :

View File

@ -59,7 +59,7 @@ HLoader {
return EventDelegate.Media.File return EventDelegate.Media.File
// If this is a preview for a link in a normal message // If this is a preview for a link in a normal message
const ext = utils.urlExtension(mediaUrl) const ext = utils.urlExtension(mediaUrl).toLowerCase()
if (imageExtensions.includes(ext)) return EventDelegate.Media.Image if (imageExtensions.includes(ext)) return EventDelegate.Media.Image
if (videoExtensions.includes(ext)) return EventDelegate.Media.Video if (videoExtensions.includes(ext)) return EventDelegate.Media.Video

View File

@ -83,7 +83,7 @@ QtObject {
function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){ function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){
// print("change", syncId, oldIndex, newIndex, field, value) print("\u001b[37mchange", syncId, oldIndex, newIndex, field, value, "\u001b[0m")
const model = ModelStore.get(syncId) const model = ModelStore.get(syncId)
model.setProperty(oldIndex, field, value) model.setProperty(oldIndex, field, value)