Compare commits

..

5 Commits

Author SHA1 Message Date
Chuck
6c7157cb5f Merge pull request #114 from ChuckPa/chuckpa/missing-ignore-errors-check
Fix unable to repair DB when UNIQUE constraint errors occur
2023-11-25 16:51:54 -08:00
ChuckPa
fa760e3ddf Update version to 1.01.04 after patch
update version to 1.01.04 after patch
2023-11-25 19:39:05 -05:00
ChuckPa
80fb3a751c Fix unable to repair DB when UNIQUE constraint errors occur
Not all DBs were repairable.  This fix addresses UNIQUE constraint failures.
2023-11-25 19:36:57 -05:00
Chuck
00bb897a92 Merge pull request #113 from ChuckPa/chuckpa/missing-ignore-errors-check
Fix unable to repair DB when UNIQUE constraint errors occur
2023-11-25 16:27:44 -08:00
ChuckPa
fcf132f9e1 Fix unable to repair DB when UNIQUE constraint errors occur
Not all DBs were repairable.  This fix addresses UNIQUE constraint failures.
2023-11-25 19:25:21 -05:00
2 changed files with 11 additions and 4 deletions

View File

@@ -2,12 +2,12 @@
######################################################################### #########################################################################
# Plex Media Server database check and repair utility script. # # Plex Media Server database check and repair utility script. #
# Maintainer: ChuckPa # # Maintainer: ChuckPa #
# Version: v1.01.02 # # Version: v1.01.04 #
# Date: 10-Nov-2023 # # Date: 25-Nov-2023 #
######################################################################### #########################################################################
# Version for display purposes # Version for display purposes
Version="v1.01.02" Version="v1.01.04"
# Flag when temp files are to be retained # Flag when temp files are to be retained
Retain=0 Retain=0
@@ -882,6 +882,8 @@ DoRepair() {
Output "Importing Main DB." Output "Importing Main DB."
"$PLEX_SQLITE" "$TMPDIR/$CPPL.db-REPAIR-$TimeStamp" < "$TMPDIR/library.plexapp.sql-$TimeStamp" "$PLEX_SQLITE" "$TMPDIR/$CPPL.db-REPAIR-$TimeStamp" < "$TMPDIR/library.plexapp.sql-$TimeStamp"
Result=$? Result=$?
[ $IgnoreErrors -eq 1 ] && Result=0
if ! SQLiteOK $Result ; then if ! SQLiteOK $Result ; then
Output "Error $Result from Plex SQLite while importing from '$TMPDIR/library.plexapp.sql-$TimeStamp'" Output "Error $Result from Plex SQLite while importing from '$TMPDIR/library.plexapp.sql-$TimeStamp'"
WriteLog "Repair - Cannot import main database from '$TMPDIR/library.plexapp.sql-$TimeStamp' - FAIL ($Result)" WriteLog "Repair - Cannot import main database from '$TMPDIR/library.plexapp.sql-$TimeStamp' - FAIL ($Result)"

View File

@@ -8,6 +8,11 @@
![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg) ![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg)
# Release Info: # Release Info:
v1.01.04
- Missing IgnoreErrors (-i / -f) test when reimporting damaged DB with certain errors prevented repair
in all cases.
v1.01.02 v1.01.02
- Correct updating when scripted versus interactive. - Correct updating when scripted versus interactive.