Update the project to run with modern uv/bun (or python/nodejs) environment #7

Merged
LeoVasanko merged 43 commits from rejuvenile into main 2025-08-15 18:03:04 +01:00
Showing only changes of commit 24eb852822 - Show all commits

View File

@ -37,17 +37,14 @@ export class Doc {
return this.url.replace(/^\/#/, '')
}
get img(): boolean {
const ext = this.name.split('.').pop()?.toLowerCase()
return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'svg'].includes(ext || '')
const ext = this.name.split('.').pop()?.toLowerCase() || ''
return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'heic', 'heif', 'svg'].includes(ext)
}
get previewable(): boolean {
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
return [
'mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf',
'avif', 'heic', 'heif', 'jpg', 'jpeg', 'png'
].includes(ext || '')
return ['mp4', 'mkv', 'webm', 'ogg', 'mp3', 'flac', 'aac', 'pdf'].includes(ext)
}
get previewurl(): string {
return this.url.replace(/^\/files/, '/preview')