Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9737 closed Patch - Feature (Won't Fix)

Editing channel number in frontend brings to lose channels

Reported by: luigi.zanderighi@… Owned by:
Priority: minor Milestone: unknown
Component: MythTV - General Version: Unspecified
Severity: medium Keywords: channel editor live_tv
Cc: luigi.zanderighi@… Ticket locked: yes


During a channel renumbering in the frontend channels can get unreachable.

I have two channels with numbering 10 and 20, i would like to renumber channel 20 to channel 10. Using the frontend in live-tv mode i renumber the channel, but now I have two channles with numbers 10. One is available the second one not. To manage the a correct channel renumbering I should put channel 10 in an unused channel number, and than put channel 20 in channel 10.

To solve this issue, the channels could be automatically swapped. So if i put channel 20->10 automatically channel 10->20.

In attachment the patch for file tv_rec.cpp

bool TVRec::SetChannelInfo?(uint chanid, uint sourceid,

QString oldchannum, QString callsign, QString channum, QString channame, QString xmltvid)


if (!chanid
!sourceid channum.isEmpty())

return false;

LZ: 'swap' channels not only update

MSqlQuery swapquery(MSqlQuery::InitCon?()); query.prepare(

"UPDATE channel " "SET channum = :OLDCHANNUM, " "WHERE channum = :CHANNUM AND " " sourceid = :SOURCEID");

swapquery.bindValue(":CHANNUM", channum); swapquery.bindValue(":SOURCEID", channame); swapquery.bindValue(":OLDCHANNUM", xmltvid);

MSqlQuery query(MSqlQuery::InitCon?()); query.prepare(

"UPDATE channel " "SET callsign = :CALLSIGN, " " channum = :CHANNUM, " " name = :CHANNAME, " " xmltvid = :XMLTVID " "WHERE chanid = :CHANID AND " " sourceid = :SOURCEID");

query.bindValue(":CALLSIGN", callsign); query.bindValue(":CHANNUM", channum); query.bindValue(":CHANNAME", channame); query.bindValue(":XMLTVID", xmltvid); query.bindValue(":CHANID", chanid); query.bindValue(":SOURCEID", sourceid);

if (!query.exec()


MythDB::DBError("SetChannelInfo?", query); return false;


if (channel)

channel->Renumber(sourceid, oldchannum, channum);

return true;


Attachments (1)

tv_rec.cpp (139.2 KB) - added by luigi.zanderighi@… 10 years ago.
Patched tv_rec.cpp

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by luigi.zanderighi@…

Attachment: tv_rec.cpp added

Patched tv_rec.cpp

comment:1 Changed 10 years ago by robertm

Resolution: Won't Fix
Status: newclosed

Changing the attributes of a channel which you are not currently editing is a quick way to infuriate users. This would be a nightmare to explain to users, and troubleshoot in the future. I don't think this is acceptable, sorry.

comment:2 Changed 10 years ago by luigi.zanderighi@…

This is the usual way all of the channel editing system work on any television, while reordering channels.

Is it correct that if I renumber a channel it disappers?

So by now it's exactly the apposite as you say, making channels disappear is a way to make users infuriate.

comment:3 Changed 10 years ago by robertm

Ticket locked: set

Channel editing on televisions generally doesn't occur, period, let alone renumbering the channels you're not editing. Moving around channel numbers of channels you are not editing is like a sliding tile game.

Note: See TracTickets for help on using tickets.