[mythtv] Trailing spaces in callsigns
jerrymr at gmail.com
Thu Sep 15 18:10:45 UTC 2011
On Thu, Sep 15, 2011 at 1:44 PM, Michael T. Dean <mtdean at thirdcontact.com>wrote:
> On 09/15/2011 12:15 PM, Jerry Rubinow wrote:
> > On Thu, Sep 15, 2011 at 12:06 PM, Stuart Morgan wrote:
> >> On Thursday 15 Sep 2011 07:44:51 Jerry Rubinow wrote:
> >>> Would a patch be accepted which trimmed off trailing whitespace in the
> >>> channel callsigns before doing the comparison for merging channels in
> >>> program guide?
> >> Would it not be easier in the long term to trim the whitespace at the
> >> the
> >> callsign is inserted into the database instead of all the places that
> >> read back from the database?
> >> A one-off DB update could address the existing instances of
> >> trailing/leading
> >> whitespace.
> Ah, yeah, I misread it thinking he was asking about fixing the callsigns
> in the editors so they're put in the database correctly. But, yeah, I
> agree it should be fixed upon insert--meaning we only need a fix for the
> 4 channel editors (mythtv-setup, frontend, MythWeb, and HTTP setup).
> > It's always possible for a user to manually insert incorrectly terminated
> > strings into the DB though, as frowned upon as it is to manually edit the
> > channel table. What about doing a normalization on the callsign entries
> > the channel table every time mythbackend starts?
> But we don't support direct DB edits, so if a user breaks his own
> configuration by editing the database without the benefit of all the
> lines of MythTV code that define and enforce data constraints (which,
> BTW, are not defined in the database), then they can edit the DB
> directly (or using one of our supported channel editors) to fix it. :)
I agree with all that. I don't like the idea of changing callsign
comparison logic for this purpose. My only reservation is that extra
whitespace is hard to diagnose, so the user (who admittedly used unsupported
data entry) wouldn't know that the entry needed to be (re)edited in the
What if the code retrieving the callsign text for display purposes replaced
trailing whitespace with X's or something like that? So the callsign
comparison code would all be unchanged, but it would be obvious in the UI
that text was incorrect?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-dev