Modify

Opened 6 years ago

Last modified 19 months ago

#10046 accepted Patch - Bug Fix

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

Reported by: Jerry Rubinow <jerrymr@…> Owned by: mdean
Priority: minor Milestone: unknown
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@…> 6 years ago.
patch for files in libmythtv
channeldata.patch (887 bytes) - added by Jerry Rubinow <jerrymr@…> 6 years ago.
patch for files in mythfilldatabase
mythtv.patch (4.6 KB) - added by Jerry Rubinow <jerrymr@…> 6 years ago.
mythweb.patch (1.1 KB) - added by Jerry Rubinow <jerrymr@…> 6 years ago.

Download all attachments as: .zip

Change History (10)

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

patch for files in libmythtv

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

patch for files in mythfilldatabase

comment:1 Changed 6 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 6 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 6 years ago by Jerry Rubinow <jerrymr@…>

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

comment:3 Changed 6 years ago by mdean

  • Owner set to mdean
  • Status changed from new to accepted

comment:4 Changed 21 months ago by Karl Dietz <dekarl@…>

In d847d55f18315175d6f8b46f821e936d459ebd9d/mythtv:

avoid \0 characters in ATSC strings, also simplify them

Refs #10046
Refs #12612

comment:5 Changed 21 months ago by Karl Dietz <dekarl@…>

In fdc94ef2465f0b596bd785dd9d39029c811f1ec6/mythtv:

update unit test for ATSC channel names after fixes

Refs #10046
Refs #12612

comment:6 Changed 19 months 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)

Add Comment

Modify Ticket

Action
as accepted The owner will remain mdean.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.