Opened 13 years ago

Closed 2 years ago

#10046 closed Patch - Bug Fix (Trac EOL)

Channel insert/updates now strip off leading/trailing whitespace in callsign and name

Reported by: Jerry Rubinow <jerrymr@…> Owned by: sphery
Priority: minor Milestone: needs_triage
Component: MythTV - General Version: Master Head
Severity: medium Keywords: database channel callsign
Cc: Ticket locked: no

Description

Modified places where channels are inserted or updated in the database to call QString::trimmed() on channel callsign and name. This prevents some potential mismatches when guide information is merged (i.e. one input has a channel with callsign "WABC" and tuner 2 has the same channel but the callsign is "WABC ", so they show up separately in the guide).

The patch modifies mfdb/channeldata.cpp, libmythtv/channelutil.cpp, libmythtv/datadirect.cpp, and libmythtv/tv_rec.cpp. This is my first patch submission, let me know if I made any mistakes in protocol. And please direct me to any other places that need modification which I missed. Finally, I verified successful compilation, but I'm unable to test.

Attachments (4)

libmythtv.patch (3.2 KB) - added by Jerry Rubinow <jerrymr@…> 13 years ago.
patch for files in libmythtv
channeldata.patch (887 bytes) - added by Jerry Rubinow <jerrymr@…> 13 years ago.
patch for files in mythfilldatabase
mythtv.patch (4.6 KB) - added by Jerry Rubinow <jerrymr@…> 13 years ago.
mythweb.patch (1.1 KB) - added by Jerry Rubinow <jerrymr@…> 13 years ago.

Download all attachments as: .zip

Change History (12)

Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Attachment: libmythtv.patch added

patch for files in libmythtv

Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Attachment: channeldata.patch added

patch for files in mythfilldatabase

comment:1 Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Now I'm able to test, and mythtv-setup doesn't seem to use the update method in channelutil.cpp. I'll update the ticket when I have something usable, but don't waste time trying to use it in the meantime.

comment:2 Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Here's is an updated and tested patch which trims callsign, channel number, and channel name in libmythtv/channelsettings.cpp, libmythtv/channelutil.cpp, libmythtv/tv_rec.cpp, and in mythweb in modules/tv/set_channels.php. I've verified the changes work correctly in the mythtv-setup channel editor, when using 'e' in the program guide, and in mythweb.

It seems like there's an extra place in the code that modifies the channel table which doesn't have a corresponding channel editor I was able to find. Also, I found two more places in the code, in mythfilldatabase and in libmythtv/datadirect.cpp, which update the channel table. I wasn't sure if these places should trim as well. They are currently unmodified.

These two patches (one for master, one for mythweb) supplant the earlier attachments.

Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Attachment: mythtv.patch added

Changed 13 years ago by Jerry Rubinow <jerrymr@…>

Attachment: mythweb.patch added

comment:3 Changed 12 years ago by sphery

Owner: set to sphery
Status: newaccepted

comment:4 Changed 8 years ago by Karl Dietz <dekarl@…>

In d847d55f18315175d6f8b46f821e936d459ebd9d/mythtv:

avoid \0 characters in ATSC strings, also simplify them

Refs #10046
Refs #12612

comment:5 Changed 8 years ago by Karl Dietz <dekarl@…>

In fdc94ef2465f0b596bd785dd9d39029c811f1ec6/mythtv:

update unit test for ATSC channel names after fixes

Refs #10046
Refs #12612

comment:6 Changed 8 years ago by Karl Dietz <dekarl@…>

In aba4858bd6b3f9abe9ba19adf8c833ba37150d61/mythtv:

avoid \0 characters in ATSC strings, also simplify them

Refs #10046
Refs #12612

(cherry picked from commit d847d55f18315175d6f8b46f821e936d459ebd9d)

comment:7 Changed 4 years ago by Stuart Auchterlonie

Milestone: unknownneeds_triage

comment:8 Changed 2 years ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: acceptedclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] - https://github.com/MythTV/mythtv/issues

Note: See TracTickets for help on using tickets.