wip: desktop work

This commit is contained in:
Adam
2025-10-28 06:20:43 -05:00
parent e29dd27632
commit 1da24f6adb
5 changed files with 17 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
import { useSync } from "@/context/sync"
export function getFilename(path: string) {
if (!path) return ""
const trimmed = path.replace(/[\/]+$/, "")
@@ -6,8 +8,10 @@ export function getFilename(path: string) {
}
export function getDirectory(path: string) {
const sync = useSync()
const parts = path.split("/")
return parts.slice(0, parts.length - 1).join("/")
const dir = parts.slice(0, parts.length - 1).join("/")
return dir ? sync.sanitize(dir + "/") : ""
}
export function getFileExtension(path: string) {