mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-11-06 03:08:55 -05:00
Viewstate import - Improve error checking and recovery
This commit is contained in:
parent
aa296cf52d
commit
b645e0f205
@ -1112,17 +1112,16 @@ do
|
|||||||
|
|
||||||
# Import viewstates into working copy
|
# Import viewstates into working copy
|
||||||
Output "Importing Viewstate data"
|
Output "Importing Viewstate data"
|
||||||
"$PLEX_SQLITE" $CPPL.db < "$TMPDIR/Viewstate.sql-$TimeStamp"
|
"$PLEX_SQLITE" $CPPL.db < "$TMPDIR/Viewstate.sql-$TimeStamp 2> /dev/null"
|
||||||
Result=$?
|
|
||||||
|
|
||||||
# Make certain the resultant DB is OK
|
# Make certain the resultant DB is OK
|
||||||
Output "Checking database following import"
|
Output "Checking database following import"
|
||||||
if ! CheckDB $CPPL.db ; then
|
|
||||||
|
|
||||||
|
if ! CheckDB $CPPL.db ; then
|
||||||
Output "Error $Result during import. Import corrupted database."
|
Output "Error $Result during import. Import corrupted database."
|
||||||
Output " Undoing viewstate import."
|
Output " Undoing viewstate import."
|
||||||
|
|
||||||
RestoreSaved "$LastTimestamp"
|
cp -p "$TMPDIR/Viewstate.db-$TimeStamp" $CPPL.db
|
||||||
WriteLog "Import - Import: $Input - FAIL"
|
WriteLog "Import - Import: $Input - FAIL"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user