[mythtv] [mythtv-commits] Ticket #8075: Patch to allow switching between all and only favorite channels in mythweb listings

Tom Dexter digitalaudiorock at gmail.com
Tue Mar 23 23:29:40 UTC 2010


On Fri, Mar 19, 2010 at 2:55 PM, Michael T. Dean
<mtdean at thirdcontact.com> wrote:
> On 03/19/2010 08:48 AM, MythTV wrote:
>>
>> #8075: Patch to allow switching between all and only favorite channels in
>> mythweb
>> listings
>>
>> -----------------------------------------------------+----------------------
>>  Reporter:  Tom Dexter                               |       Owner:
>>  kormoc
>>      Type:  enhancement                              |      Status:  new
>>  Priority:  minor                                    |   Milestone:
>>  unknown
>> Component:  Plugin - MythWeb                         |     Version:
>>  unknown
>>  Severity:  medium                                   |     Mlocked:  0
>>
>> -----------------------------------------------------+----------------------
>>
>> Comment(by Tom Dexter):
>>
>>  Once I got thinking about this more it occurred to me:  If there's a
>>  channel group dropdown list in the listings page and your choice gets
>>  remembered in the session, does it even make sense to have that
>> duplicated
>>  in the Settings page?  To me it's make more sense to just remove the old
>>  "Only display favourite channels" checkbox in the settings.  That would
>> be
>>  much like that "Show recordings:" dropdown list inthe recorded programs
>>  page.   What do you think?
>>
>
> I completely agree.  That said, you should probably still get buy-in (on
> both the idea and the proposed implementation in your last comment) from Rob
> Smith or Chris Petersen (since they're the MythWeb decision makers).
>
> From my perspective, though, it would be great in that it would be a single,
> and consistent, fix for both http://svn.mythtv.org/trac/ticket/7536 and
> http://svn.mythtv.org/trac/ticket/8075 .
>
>>  One area I'd have to look into that I'm not familiar with is how this
>>  might impact the other templates, especially the iPod one.
>>
>
> Agreed--on default, I like the approach you're recommending.  On the other
> templates, though, I'm not sure what the best approach would be.
>
> Oh, and thanks a lot for the motivation.  It's nice to see someone willing
> to extend their patch.
>
> Thanks,
> Mike
>

OK...I've had a chance to work on this and it's coming along well.
I've been able to add an option list in the "Jump to" section of the
guide with a first value of "All Channels", followed by a list of any
channel groups that actually have channels assigned.

I was confused by one thing I ran across that was totally broken.
Maybe someone can verify whether my fix is OK:

The default and lite templates both share the same function to build
an option list of dates in the guide.  The actual values in the option
list are epoch times (based on the appropriate date and the currently
selected hour).  As far as I see, this is how that must be setup for
the default template, as that uses this value in the ajax call in the
onchange event of the option list and sends that value as 'time'.

When the lite template uses this, it gets submitted in the form using
the name 'date' along with the 'hour' value.  The problem is that
modules/tv/list.php was assuming that 'date' was in a format of
YYYYMMDD:

// Did we get passed a date (and probably an hour, too)?
    elseif(isset($_REQUEST['date']))
        $list_starttime = unixtime(sprintf('%08d%02d0000',
$_REQUEST['date'], $_REQUEST['hour']));

That was completely broken and jumping using the lite template came up
with NO DATA for all channels.  I changed the above code to:

// Did we get passed a date (and probably an hour, too)?
    elseif(isset($_REQUEST['date']))
        $list_starttime = unixtime(sprintf('%08d%02d0000',
date('Ymd',$_REQUEST['date']), $_REQUEST['hour']));

Which corrects it.  From what I can see, I'm not finding any other
code that would try to pass a YYYYMMDD format date into that, but I'd
like to be sure.

The only other area I'm still unclear on is what to do with the
settings.  The "Only display favourite channels" becomes obsolete with
this mod.  I could either replace the  "Only display favourite
channels" in the settings with an option list similar to the one in
the guide, or just remove the "Only display favourite channels", as
the session setting gets set in the guide.  I don't know if there's
any compelling reason to have it in the settings or not.

Any opinions on that one?

One other thing I wanted to be sure I had correct:  For the first
option in option list I'm using a translated t('All channels').  For
everything else I'm just using the html encoded version of what ever
was in channelgroupnames.  I'm assuming this is correct since these
are all user entered(??).

Thanks.
Tom


More information about the mythtv-dev mailing list