Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files): do not even try to fetch a preview if èhas-preview` is false
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv authored and AndyScherzinger committed May 26, 2025
commit 4ed1050ccfe657cc5b171f736c6888609f9cc1e9
12 changes: 12 additions & 0 deletions apps/files/src/components/FileEntry/FileEntryPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down