Skip to content

Commit

Permalink
Use isEmpty instead of isNull in UpdateChannel (#994)
Browse files Browse the repository at this point in the history
Use isEmpty instead of isNull in ChannelUtil::UpdateChannel to
handle both an empty string and no string in the same way.
With an IPTV channel rescan the existing values of xmltvid and
icon are now preserved when there are no new values found in the scan.

Refs #973
  • Loading branch information
kmdewaal authored Dec 11, 2024
1 parent 3bb9c29 commit 20a721d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mythtv/libs/libmythtv/channelutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,15 +1629,15 @@ bool ChannelUtil::UpdateChannel(uint db_mplexid,
" visible = :VISIBLE, service_type = :SERVICETYPE "
"WHERE chanid=:CHANID")
.arg((!set_channum) ? "" : "channum = :CHANNUM, ",
(freqid.isNull()) ? "" : "freqid = :FREQID, ",
(icon.isNull()) ? "" : "icon = :ICON, ",
(tvformat.isNull()) ? "" : "tvformat = :TVFORMAT, ",
(xmltvid.isNull()) ? "" : "xmltvid = :XMLTVID, ",
(default_authority.isNull()) ?
"" : "default_authority = :AUTHORITY,",
(freqid.isEmpty()) ? "" : "freqid = :FREQID, ",
(icon.isEmpty()) ? "" : "icon = :ICON, ",
(tvformat.isEmpty()) ? "" : "tvformat = :TVFORMAT, ",
(xmltvid.isEmpty()) ? "" : "xmltvid = :XMLTVID, ",
(default_authority.isEmpty()) ?
"" : "default_authority = :AUTHORITY,",
(recpriority == INT_MIN) ? "" : "recpriority = :RECPRIORITY, ",
(tmOffset == INT_MIN) ? "" : "tmOffset = :TMOFFSET, ",
(commMethod == INT_MIN) ? "" : "commmethod = :COMMMETHOD, ");
(tmOffset == INT_MIN) ? "" : "tmOffset = :TMOFFSET, ",
(commMethod == INT_MIN) ? "" : "commmethod = :COMMMETHOD, ");

MSqlQuery query(MSqlQuery::InitCon());
query.prepare(qstr);
Expand Down

0 comments on commit 20a721d

Please sign in to comment.