Implement media preview thumbnails for Gallery

This commit is contained in:
Leo Vasanko
2023-11-18 11:38:25 -08:00
parent 85ac12ad33
commit 696e3ab568
9 changed files with 57 additions and 9 deletions

View File

@@ -40,6 +40,9 @@ export class Doc {
const ext = this.name.split('.').pop()?.toLowerCase()
return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'svg'].includes(ext || '')
}
get previewurl(): string {
return this.url.replace(/^\/files/, '/preview')
}
get ext(): string {
const ext = this.name.split('.').pop()
return ext ? ext.toLowerCase() : ''