Fix:Bad backup causing other backup files to not be displayed #1961

This commit is contained in:
advplyr 2023-09-30 16:01:10 -05:00
parent 9ebe23e91b
commit c2c8cf919e
2 changed files with 2 additions and 3 deletions

View File

@ -196,7 +196,7 @@ class MeController {
const libraryItem = await Database.libraryItemModel.getOldById(localProgress.libraryItemId) const libraryItem = await Database.libraryItemModel.getOldById(localProgress.libraryItemId)
if (!libraryItem) { if (!libraryItem) {
Logger.error(`[MeController] syncLocalMediaProgress invalid local media progress object no library item`, localProgress) Logger.error(`[MeController] syncLocalMediaProgress invalid local media progress object no library item with id "${localProgress.libraryItemId}"`, localProgress)
continue continue
} }

View File

@ -100,7 +100,7 @@ class BackupManager {
let entries let entries
try { try {
entries = await zip.entries() entries = await zip.entries()
} catch(error){ } catch (error) {
// Not a valid zip file // Not a valid zip file
Logger.error('[BackupManager] Failed to read backup file - backup might not be a valid .zip file', tempPath, error) Logger.error('[BackupManager] Failed to read backup file - backup might not be a valid .zip file', tempPath, error)
return res.status(400).send('Failed to read backup file - backup might not be a valid .zip file') return res.status(400).send('Failed to read backup file - backup might not be a valid .zip file')
@ -182,7 +182,6 @@ class BackupManager {
data = await zip.entryData('details') data = await zip.entryData('details')
} catch (error) { } catch (error) {
Logger.error(`[BackupManager] Failed to unzip backup "${fullFilePath}"`, error) Logger.error(`[BackupManager] Failed to unzip backup "${fullFilePath}"`, error)
await zip.close()
continue continue
} }