[mythtv] [Committed] DataDirect "Movie" category_type
Ben Bucksch
linux.news at bucksch.org
Mon May 17 05:42:41 EDT 2004
Bruce Markey wrote:
> Machines can read case insensitive strings just fine. In fact, the SQL
> query is case insensitive
LIKE is unnecessarily slow, for one.
> In a quick grep I only found tr("Movie") used for this purpose
I quoted at least one instance of just "movie" in the code, there are
many more, in mythtv, mythweb and external code. I tried to eliminate
all relevant instances (I found only 1 or 2) of tr("Movie") for cat_type
in my patch.
> Which movie search screen using which grabber?
MythTV | TV | Schedule | Search | Movies
My own grabber
> I seem to remember that this needs to match "Movies" (with an "s")
> and/or things like "Action Movies" for at least some people.
"Action Movies" should be written into field category, not cat_type,
that's exactly the difference between category and cat_type.
> The "category" is used for coloring
> in the EPG and mythweb but that's a different topic.
Mythweb uses cat_type = 'movie' for finding movies. At least in a number
of places, and it should everywhere.
[mythfilldatabase code]
> It's also interesting that those four types seem to be derived
> from Zap2it's TMS database programid prefixes of MV%, EP% (meaning
> EPisode of a series), SP% and SH%.
No, they are a subset (the unambiguous one) of what my grabber source sends.
> Here is what I have for category_type filled in directly from
> the TMS data:
>
> mysql> select category_type from program group by category_type;
> +------------------+
> | category_type |
> +------------------+
> | |
> | Limited Series |
> | Movie |
> | Paid Programming |
> | Series |
> | Short Film |
> | Special |
> +------------------+
> 7 rows in set (0.01 sec)
Thanks. "paid", "limited" doesn't belong there, it's orthogonal, to my
understanding. "series" (lower case) is already defined and should be
written in, it may be useful for scheduling. "short film" is a candidate
for addition. I don't know what "Special" is supposed to be.
If anybody adds new cat_types, please make sure they are universially
understood ("movie", "sports", "series") or defined/explained, so we all
know what's meant with it.
>> *sigh*. I just see that it's called "showtype" and not "cat_type". I
>> don't know the internal DD grabber or what it does there, but it
>> should set the cat_type to one of the following values, if appropriate:
>>
>> * movie
>> * series (Simpsons, Star Trek etc.)
>> * sports
>> * tvshow (talkshow, cabaret etc.)
>
> I think your assumption that this is predetermined, fixed, or required
> is incorrect.
If you mean "this" = cat_type (not showtype), then no, it's not an
assumption, it's a definition. I implemented cat_type, and I defined
cat_type like this. Anything writing arbitary strings in there (esp.
localized ones!) is a bug, probably due to the absense of documentation.
> Like "category", it depends on the language, the data source and the
> grabber.
No, it's MythTV-internal field, and mythfilldatabase is supposed to
translate from the grabber to this field where approriate. There are
many places where movies are looked for, and it doesn't make sense to
add special code for every grabber in all places, just fill in "movie"
into "cat_type" during grabbing and all places should work. My grabber
has a special tag for movies, DD does this MV*-ID, the XMLTV american
grabber has some guessing rules already implemented in mythfilldatabase.
This ensures that we have one place - the grabbing - where grabber
dependencies on movie recognition are implemented, and the rest of the
code can just rely on cat_type = "movie", and we are all on the same
page, internationally. That was the whole idea of the field.
This even works if you use grabbers from different countries, are in a
multi-language country (NL, CH) or are changing your mind about which UI
language you want to use (or I use English and my grandgrandfather's
frontend uses German, with the same backend, or I am just lonely using
the English UI translation with German data). There are more reasons,
too many to list. The DB should not depend on the UI language.
> If you have a problem with your movie list for Search Listings->
> Movies or even the Movies link in mythweb, I'd be happy to work with
> you to track it down.
> no indication of a solution for whatever problem you may be seeing.
The current code breaks for me, because my grabber together with
mythfilldatabase (correctly) writes "movie" into cat_type, but somebody
translated "movie" in the DB query, which is of course bound to break.
See above for why it doesn't make sense to translate. I tried to change
all code to write "movie" into the DB and read = "movie" from it.
However, I couldn't test it, because I don't have a DD grabber (not do I
want to set it up and sign up). Did you apply my patch and try it? It
may or may not work for DD (I tried, but may have failed), but it
shouldn't be hard to adapt.
We really need some DB documentation.
More information about the mythtv-dev
mailing list