Skip to content

Commit

Permalink
Fix some minor issues with videosource entries.
Browse files Browse the repository at this point in the history
Allow userid to be NULL.  Change empty userids to NULL.  Change
obsolete, datadirect credentials to NULL.

Based on patches from Gary Buhrmaster <gary.buhrmaster@gmail.com>.

Fixes #13521
Fixes #13522
  • Loading branch information
gigem committed Dec 2, 2019
1 parent 1c0d46a commit 40c031a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/perl/MythTV.pm
Expand Up @@ -116,7 +116,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
our $SCHEMA_VERSION = "1357";
our $SCHEMA_VERSION = "1359";

# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
Expand Down
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/static.py
Expand Up @@ -5,7 +5,7 @@
"""

OWN_VERSION = (30,0,-1,0)
SCHEMA_VERSION = 1357
SCHEMA_VERSION = 1359
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1024
PROTO_VERSION = '91'
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -75,7 +75,7 @@
* mythtv/bindings/php/MythBackend.php
*/

#define MYTH_DATABASE_VERSION "1358"
#define MYTH_DATABASE_VERSION "1359"


MBASE_PUBLIC const char *GetMythSourceVersion();
Expand Down
20 changes: 20 additions & 0 deletions mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -3679,6 +3679,26 @@ nullptr
return false;
}

if (dbver == "1358")
{
const char *updates[] = {
// Allow videosouce.userid to be NULL as originally intended.
"ALTER TABLE videosource "
" CHANGE COLUMN userid userid VARCHAR(128) NULL DEFAULT NULL",
// And fix any leftover, empty values.
"UPDATE videosource "
" SET userid = NULL "
" WHERE userid = ''",
// Remove potential clear text credentials no longer usable
"UPDATE videosource "
" SET userid = NULL, password = NULL "
" WHERE xmltvgrabber IN ('schedulesdirect1', 'datadirect')",
nullptr
};
if (!performActualUpdate(updates, "1359", dbver))
return false;
}

return true;
}

Expand Down

0 comments on commit 40c031a

Please sign in to comment.