Skip to content

Commit

Permalink
Don't insert a default value of 'none' into the icon column of the ch…
Browse files Browse the repository at this point in the history
…annel table. Fixes #10610
  • Loading branch information
stuartm committed Oct 8, 2012
1 parent 39984eb commit 563fc37
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/perl/MythTV.pm
Expand Up @@ -115,7 +115,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 = "1307";
our $SCHEMA_VERSION = "1308";

# 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 = (0,26,-1,1)
SCHEMA_VERSION = 1307
SCHEMA_VERSION = 1308
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
PROTO_VERSION = '75'
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -57,7 +57,7 @@
* mythtv/bindings/php/MythBackend.php
#endif

#define MYTH_DATABASE_VERSION "1307"
#define MYTH_DATABASE_VERSION "1308"


MBASE_PUBLIC const char *GetMythSourceVersion();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/dbchannelinfo.cpp
Expand Up @@ -36,7 +36,7 @@ DBChannel::DBChannel(
uint _sourceid, uint _cardid, uint _grpid) :
channum(_channum),
callsign(_callsign),
name(_name), icon((_icon == "none") ? QString() : _icon),
name(_name), icon(_icon),
chanid(_chanid),
major_chan(_major_chan), minor_chan(_minor_chan),
mplexid((_mplexid == 32767) ? 0 : _mplexid),
Expand Down
13 changes: 12 additions & 1 deletion mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -2277,6 +2277,17 @@ NULL
return false;
}

if (dbver == "1307")
{

const char *updates[] = {
"ALTER TABLE channel MODIFY COLUMN icon varchar(255) NOT NULL DEFAULT '';",
NULL
};
if (!performActualUpdate(&updates[0], "1308", dbver))
return false;
}

return true;
}

Expand Down Expand Up @@ -2381,7 +2392,7 @@ bool InitializeMythSchema(void)
" sourceid int(10) unsigned DEFAULT NULL,"
" callsign varchar(20) NOT NULL DEFAULT '',"
" `name` varchar(64) NOT NULL DEFAULT '',"
" icon varchar(255) NOT NULL DEFAULT 'none',"
" icon varchar(255) NOT NULL DEFAULT '',"
" finetune int(11) DEFAULT NULL,"
" videofilters varchar(255) NOT NULL DEFAULT '',"
" xmltvid varchar(255) NOT NULL DEFAULT '',"
Expand Down
5 changes: 2 additions & 3 deletions mythtv/programs/mythfilldatabase/icondata.cpp
Expand Up @@ -171,10 +171,9 @@ void IconData::UpdateSourceIcons(uint sourceid)
"FROM (channel ch, callsignnetworkmap csm) "
"RIGHT JOIN networkiconmap nim ON csm.network = nim.network "
"WHERE ch.callsign = csm.callsign AND "
" (icon = :NOICON OR icon = '') AND "
" icon = '' AND "
" ch.sourceid = :SOURCEID");
query.bindValue(":SOURCEID", sourceid);
query.bindValue(":NOICON", "none");

if (!query.exec())
{
Expand Down Expand Up @@ -556,6 +555,6 @@ void IconData::ResetIconMap(bool reset_icons)

if (reset_icons)
{
RunSimpleQuery("UPDATE channel SET icon = 'none'");
RunSimpleQuery("UPDATE channel SET icon = ''");
}
}

0 comments on commit 563fc37

Please sign in to comment.