[mythtv] Intro and Mythweb

Chris Petersen lists at forevermore.net
Tue Nov 1 02:49:30 EST 2005

> I've been working on some changes to mythweb lately, and wanted to run
> them by you all. My goal is to add support for mythweb themes that use 
> AJAX. (there's a good description of AJAX at 
> http://en.wikipedia.org/wiki/AJAX if you're unfamiliar with it)

At least the recorded programs page already does this.

> An AJAX theme has the potential to be much more responsive, since the 
> amount of data that needs to be initially loaded is smaller and changes 
> can be made to the database without refreshing the entire page. Many 
> tasks in mythweb will be dramatically more fluid.

Agreed.  I'd next like to get the scheduled recordings page set up for 
AJAX support, but there are some things that should happen first..  read on.

> The downside of this is that it requires a fair amount of code 
> restructuring. Currently, mythweb builds large data structures that it 
> then passes to the theme for display. That's a slow process, especially 
> when an AJAX request may use only a tiny portion of that data.

Yup.  Except that passing "large" stuff by reference shouldn't be all 
that slow.  I agree that it's a bad idea for a lot of stuff, though.

> So instead, I propose that rather than using global variables, mythweb 
> would instead provide functions that query and return specific pieces of 
> data. Themes that need all the information at once can easily retrieve 
> it, while themes that don't can avoid paying the overhead.

It needs both, actually.

> I'd say I'm about half way through this process now. I've done a fair 
> portion of the restructuring (though a lot of cleanup work remains) and 
> I have several of the basic pages working in a new AJAX-based theme.

You didn't mention if you were working against SVN or .18.x -- there's a 
big difference between the two.

Here's why I haven't been accepting large mythweb patches recently (and 
why I haven't done much developing)..

  * Primarily, I've been working on my house and my yard (since it was
  * Lately, I'm suffering/recovering from a repetitive-stress type
    arm/shoulder injury and try to stay away from the computer as much as
    possible while at home.  Such is life, but I'd rather heal now than
    live with this for the rest of my life.
  * I'm working on a major rewrite of how my programs are architected
    (see https://svn.forevermore.net/cooktools/ for pieces).  Until I get
    this in place, I won't accept any core updates to mythweb, and
    anything you write against the current tree won't work once I make
    the updates.

There are a handful of things I *will* accept patches for:

  * Mythweb's "video" section (it sucks, I didn't write it, I want it to
    be rewritten or go away, but I don't use mythvideo so I'm not the one
    to rewrite it.
  * Mythweb's "music" section (same as above)
  * "search" type recording profiles (I should have put these in ages
    ago, but still haven't found the time to do so)

For your info, on my rewrite, I plan to segregate the current "themes" 
into "themes" and "skins"...  There will be two themes: full and minimal 
(with vxml, wml, etc. as well, but not part of the usual choices).  Full 
will have full ajax/javascript support (again, usable without, but 
severely limited), and minimal will bring back the ideas previously used 
in the "compact" theme.  Everything will be driven via css, so it will 
allow mythweb to be skinnable to fit your preferred color schemes, etc.

The current theme API will be completely rewritten to get rid of the 
crappy object-based way I originally came up with, and will be replaced 
with a much better one that's taking form in my cooktools project.

Portions of mythweb are getting relicensed or dual-licensed as LGPL so 
that I can share code with work (eg. includes/db.php and all javascript 
code) -- meaning Silicon Mechanics employees (we'll be 3 coders in a 
couple of weeks) will officially contribute at least small portions of 
code to MythWeb, but the only way I can do this is if the code is 
licensed in such a way that the company can benefit, too.  My reading of 
the GPL, especially version 3, won't allow this, and if I accept many 
changes to files that are currently 100% my work (I can provice an 
exclusive license for any of my code), it will move into a legal grey 
area that I don't want to deal with.

Coinciding with a move to using phpdoc at work, I also plan to do the 
same for my personal php projects, including mythweb.  So expect to see 
phpdoc comments getting added in, expecially descriptive stuff for each 
file (like the license type).  Dunno if I'll get a phpdoc site set up 
for mythweb, but at least the code will be well documented.

*If* someone wants to help with this major rewrite, I'm open to help, 
but as I'm not entirely finished with the design ideas yet, there will 
be a lot of conversation needed.  Contact me on irc if you want to talk 
about it.


More information about the mythtv-dev mailing list