Permalink
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.
(cherry picked from commit f37917f)
  • Loading branch information...
sphery committed Jun 13, 2011
1 parent bc746e8 commit 572b95aa59d76a22aa0f4561ee25f6452366f420
Showing with 2 additions and 12 deletions.
  1. +2 −12 mythtv/programs/mythfilldatabase/main.cpp
@@ -957,19 +957,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 572b95a

Please sign in to comment.