fix: avoid hiding remote lookup errors

This commit is contained in:
Tom Boullay
2026-04-27 17:22:26 +02:00
parent fd586f4185
commit 382b28103e
3 changed files with 11 additions and 16 deletions
+2 -8
View File
@@ -52,14 +52,8 @@ export async function POST(req: NextRequest) {
// --- Detect existing files and classify changes ---
const folderPath = getModelFolderPath(folderName)
let remoteFileMap: Map<string, number>
try {
const remote = await getRemoteFolder(folderPath)
remoteFileMap = new Map(remote.files.map((f) => [f.name.toLowerCase(), f.size]))
} catch {
remoteFileMap = new Map()
}
const remote = await getRemoteFolder(folderPath)
const remoteFileMap = new Map(remote.files.map((f) => [f.name.toLowerCase(), f.size]))
const isReplace = remoteFileMap.size > 0