Browse files

Use settings code to store mythfilldatabase HaveRepeats.

Modify mythfilldatabase to use the main settings code to store the
HaveRepeats setting data.  This will prevent scheduling issues that can
occur when users/scripts/packages/whatever break the MythTV settings
table data through direct DB editing or invalid partial database restore
procedures, or when users have extremely bad luck and that one
particular row is corrupted in the database binary data files and
"fixed" by mysqlcheck/REPAIR table by deleting the row.
  • Loading branch information...
1 parent d27bedf commit f37917f9476aadf33f2eb35df5d423700a438c33 @sphery sphery committed Jun 13, 2011
Showing with 2 additions and 12 deletions.
  1. +2 −12 mythtv/programs/mythfilldatabase/main.cpp
View
14 mythtv/programs/mythfilldatabase/main.cpp
@@ -676,19 +676,9 @@ int main(int argc, char *argv[])
if (query.exec() && query.next())
{
if (query.value(0).toInt() != 0)
- {
- query.prepare("UPDATE settings SET data = '1' "
- "WHERE value = 'HaveRepeats';");
- if (!query.exec())
- MythDB::DBError("Setting HaveRepeats", query);
- }
+ gCoreContext->SaveSettingOnHost("HaveRepeats", "1", NULL);
else
- {
- query.prepare("UPDATE settings SET data = '0' "
- "WHERE value = 'HaveRepeats';");
- if (!query.exec())
- MythDB::DBError("Clearing HaveRepeats", query);
- }
+ gCoreContext->SaveSettingOnHost("HaveRepeats", "0", NULL);
}
}

0 comments on commit f37917f

Please sign in to comment.