Auto select of gallery based on previewable files whenever folder changes, added more file extensions to autodetection.

This commit is contained in:
Leo Vasanko
2025-08-14 11:20:33 -07:00
parent 6d2989472e
commit e557bedac1
2 changed files with 9 additions and 2 deletions

View File

@@ -44,7 +44,10 @@ export class Doc {
if (this.img) return true
const ext = this.name.split('.').pop()?.toLowerCase()
// Not a comprehensive list, but good enough for now
return ['mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf'].includes(ext || '')
return [
'mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf',
'avif', 'heic', 'heif', 'jpg', 'jpeg', 'png'
].includes(ext || '')
}
get previewurl(): string {
return this.url.replace(/^\/files/, '/preview')