diff --git a/Apps/Scraper/launch.sh b/Apps/Scraper/launch.sh index 575e4e89..ba05b8b6 100644 --- a/Apps/Scraper/launch.sh +++ b/Apps/Scraper/launch.sh @@ -28,8 +28,13 @@ previous_crc_DB=$(cat "$crc_DB_file") echo "Current show.json CRC32: $current_crc_Emus | Current Menu_cache7.db CRC32: $current_crc_DB" echo "Previous show.json CRC32: $previous_crc_Emus | Previous Menu_cache7.db CRC32: $previous_crc_DB" - - +sync +contains_hashes=$(sqlite3 "$database_file" "SELECT COUNT(*) FROM Menu_roms WHERE disp LIKE '%##%';") +# If any 'disp' field contains '##', delete the database +if [ "$contains_hashes" -gt 0 ]; then + rm -f "$database_file" + echo "Corrupted Ssraper database, re-building..." +fi # If CRC32 have changed, perform operations and update CRC file if [ "$current_crc_Emus" != "$previous_crc_Emus" ] || [ "$current_crc_DB" != "$previous_crc_DB" ]; then diff --git a/Apps/SystemTools/launch.sh b/Apps/SystemTools/launch.sh index fabed8e5..366d114e 100644 --- a/Apps/SystemTools/launch.sh +++ b/Apps/SystemTools/launch.sh @@ -14,6 +14,7 @@ mkdir -p /mnt/SDCARD/System/etc if [ ! -f "/mnt/SDCARD/System/etc/crossmix.json" ]; then touch "/mnt/SDCARD/System/etc/crossmix.json" fi +sync ####################################### For testing : # rm "$database_file" @@ -32,7 +33,17 @@ if [ "$rebuildmenu" = true ]; then sync LaunchMessage="Building Menu..." else - LaunchMessage="Loading..." + LaunchMessage="Loading..." + + contains_hashes=$(sqlite3 "$database_file" "SELECT COUNT(*) FROM Menu_roms WHERE disp LIKE '%##%';") + # If any 'disp' field contains '##', delete the database + if [ "$contains_hashes" -gt 0 ]; then + rm -f "$database_file" + echo "Corrupted System Tools database, re-building..." + LaunchMessage="Re-Building Menu..." + fi + + fi /mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "$LaunchMessage"