summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael T. Dean <mdean@mythtv.org>2011-06-13 16:33:20 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-06-23 18:42:18 (GMT)
commit572b95aa59d76a22aa0f4561ee25f6452366f420 (patch)
treeebbeab5ec54dc8c0a8460dcfa2105d8ec1b65026
parentbc746e8bfdeac4e272ec728856def3fbb435074a (diff)
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 f37917f9476aadf33f2eb35df5d423700a438c33)
-rw-r--r--mythtv/programs/mythfilldatabase/main.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/mythtv/programs/mythfilldatabase/main.cpp b/mythtv/programs/mythfilldatabase/main.cpp
index c191e1e..5886b3f 100644
--- a/mythtv/programs/mythfilldatabase/main.cpp
+++ b/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);
}
}