Update file extensions for previews.
This commit is contained in:
parent
e557bedac1
commit
24eb852822
@ -37,17 +37,14 @@ export class Doc {
|
|||||||
return this.url.replace(/^\/#/, '')
|
return this.url.replace(/^\/#/, '')
|
||||||
}
|
}
|
||||||
get img(): boolean {
|
get img(): boolean {
|
||||||
const ext = this.name.split('.').pop()?.toLowerCase()
|
const ext = this.name.split('.').pop()?.toLowerCase() || ''
|
||||||
return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'svg'].includes(ext || '')
|
return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'heic', 'heif', 'svg'].includes(ext)
|
||||||
}
|
}
|
||||||
get previewable(): boolean {
|
get previewable(): boolean {
|
||||||
if (this.img) return true
|
if (this.img) return true
|
||||||
const ext = this.name.split('.').pop()?.toLowerCase()
|
const ext = this.name.split('.').pop()?.toLowerCase() || ''
|
||||||
// Not a comprehensive list, but good enough for now
|
// Not a comprehensive list, but good enough for now
|
||||||
return [
|
return ['mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf'].includes(ext)
|
||||||
'mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf',
|
|
||||||
'avif', 'heic', 'heif', 'jpg', 'jpeg', 'png'
|
|
||||||
].includes(ext || '')
|
|
||||||
}
|
}
|
||||||
get previewurl(): string {
|
get previewurl(): string {
|
||||||
return this.url.replace(/^\/files/, '/preview')
|
return this.url.replace(/^\/files/, '/preview')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user