bring up to date with github

This commit is contained in:
Garret Patti
2026-04-05 10:01:34 -04:00
parent 1c3a0fe4ee
commit de8ba04bd3
14 changed files with 316 additions and 129 deletions

View File

@@ -1,6 +1,7 @@
import fs from 'fs'
import path from 'path'
import type { DirectoryListing, FileEntry, MediaType } from '@/types'
import { resolveAndJail } from '@/lib/libraries'
const HIDDEN_FILES = /^\./
@@ -27,9 +28,12 @@ export function scanDirectory(
libraryId: string,
subpath: string
): DirectoryListing {
const absPath = subpath
? path.resolve(libraryRoot, subpath)
: libraryRoot
let absPath: string
try {
absPath = subpath ? resolveAndJail(libraryRoot, subpath) : libraryRoot
} catch {
return { path: subpath, entries: [] }
}
let dirents: fs.Dirent[]
try {