Merge pull request #52819 from nextcloud/backport/52809/stable31

[stable31] fix(files): do not even try to fetch a preview if `has-preview` is false
pull/53127/head
Ferdinand Thiessen 2025-05-27 07:58:53 +07:00 committed by GitHub
commit 8bb41fb708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

@ -21,6 +21,7 @@
class="files-list__row-icon-blurhash"
aria-hidden="true" />
<img v-if="backgroundFailed !== true"
:key="source.fileid"
ref="previewImg"
alt=""
class="files-list__row-icon-preview"
@ -147,6 +148,17 @@ export default defineComponent({
return null
}
if (this.source.attributes['has-preview'] !== true
&& this.source.mime !== undefined
&& this.source.mime !== 'application/octet-stream'
) {
const previewUrl = generateUrl('/core/mimeicon?mime={mime}', {
mime: this.source.mime,
})
const url = new URL(window.location.origin + previewUrl)
return url.href
}
try {
const previewUrl = this.source.attributes.previewUrl
|| (this.isPublic

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long