[mythtv] Trailing spaces in callsigns

Daniel Kristjansson danielk at cuymedia.net
Tue Oct 11 12:47:08 UTC 2011


I assume this is for the channel editor in mythtv-setup.
  Run mythtv-setup
  Select on "Channel Editor"
  Select on one of channels
  The Callsign should be third down from the top in the left column.

There is a channel editor in the frontend
  Enter LiveTV
  Hit the EDIT key, usually "E"
  Callsign will be the top text entry box
If you want to know how that is saved, it is via the "SET_CHANNEL_INFO"
command. ctx->recorder->SetChannelInfo() in tv_play.cpp eventually makes
its way to TVRec::SetChannelInfo() in tv_rec.cpp, so you just need to
add .trimmed() to the update there.

-- Daniel

On Mon, 2011-10-10 at 22:58 -0400, Jerry Rubinow wrote:
> On Mon, Oct 10, 2011 at 9:15 AM, Daniel Kristjansson
> <danielk at cuymedia.net> wrote:
>         On Sat, 2011-10-08 at 23:24 -0400, Jerry Rubinow wrote:
>         
>         > I've managed to locate where the updated channel info is
>         getting into
>         > the database in the mythtv-setup channel editor, and the
>         initial
>         > suggestion from Mike and Stuart of simply trimming the
>         argument to the
>         > UPDATE/INSERT doesn't look like it is going to work in this
>         case.  The
>         > channel editor uses some kind of data-driven system which
>         ends up
>         > calling ConfigurationGroup::Save => SimpleDBStorage::Save,
>         which is a
>         > very generic method for updating table info and would have
>         no idea
>         > what and when to trim.  It just cycles through the list of
>         data and
>         > writes out each piece.  There may be a way to do it, but I
>         don't
>         > understand how the mythtv-setup UI system works in
>         connection with the
>         > data it's updating.
>         
>         
>         SimpleDBStorage::GetSetClause(...) const is virtual, you can
>         override it
>         in the Callsign class in channelsettings.cpp. Make it
>         something like:
>         
>         QString Callsign::GetSetClause(MSqlBindings &bindings) const
>         {
>           QString tagname(":SET" + GetColumnName().toUpper());
>           QString clause(ChannelDBStorage::GetSetClause(bindings));
>           bindings[tagname] = user->GetDBValue().trimmed();
>           return clause;
>         }
>         
>         Basically, this runs the parent's GetSetClause() method, but
>         rebinds
>         :SETCALLSIGN with a trimmed version of the callsign value.
> 
> 
> Thanks Daniel, that worked perfectly.   And I have a mod for the
> mythweb channel editor done too.
> 
> 
> Now I just need to know where the channel editor in the frontend is (I
> feel stupid asking, but I was unable to find it browsing through the
> menus), and what HTTP setup is.  If those don't prove troublesome, I
> should be able to generate a patch this week.
> 
> 
> Thanks,
> Jerry




More information about the mythtv-dev mailing list