[mythtv] [Committed] DataDirect "Movie" category_type
Ben Bucksch
linux.news at bucksch.org
Sun May 16 04:28:56 EDT 2004
Ben Bucksch wrote:
> Can you change the "Movie" to "movie", please? Because this is
> supposed to be machine-readable, the difference matters, at least in
> the longer term.
I just checked and see that roughly the same bug appears in proglist.cpp
as well:
arg(tr("Movie").utf8())
This is the reason why I saw no results in the movie search screen,
although my database is populated with the info - if you translate it,
it's going to break. Patch attached - can you please apply that?*
Category type is an enum, just expressed as string, and thus all values
should be well-defined and are not meant for direct display to users.
They are all-lowercase, and mythfilldatabase adds them as such to the
DB. Similarily, there's no need to do a LIKE search, they match exactly.
See filldata.cpp for currently defined values:
(cat == "movie" || cat == "series" || cat == "sports" ||
cat == "tvshow")
(unfortunately, there's no documentation on the DB, or I would have
added it there).
* I couldn't try it, because a fresh checkout fails during linking with
"libmythavcodec-0.15.so: undefined reference to `wm0101'", but it should
work, after datadirect.cpp went over the data.
Ben
-------------- next part --------------
? ann
? cattype_movie.diff
Index: datadirect.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/datadirect.cpp,v
retrieving revision 1.4
diff -u -r1.4 datadirect.cpp
--- datadirect.cpp 16 May 2004 01:21:14 -0000 1.4
+++ datadirect.cpp 16 May 2004 07:53:00 -0000
@@ -96,7 +96,7 @@
if (curr_program.programid.left(2) == QString("MV"))
{
- curr_program.showtype = "Movie";
+ curr_program.showtype = "movie";
}
}
else if (currtagname == "crew")
Index: proglist.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/proglist.cpp,v
retrieving revision 1.29
diff -u -r1.29 proglist.cpp
--- proglist.cpp 15 May 2004 19:27:32 -0000 1.29
+++ proglist.cpp 16 May 2004 07:53:00 -0000
@@ -752,14 +752,12 @@
else if (type == plMovies) // list movies
{
where = QString("WHERE channel.visible = 1 "
- "AND (program.category_type LIKE \"\%%1\%\" "
- "OR programid LIKE \"MV\%\") "
- "AND program.endtime > %2 "
+ "AND (program.category_type = \"movie\" "
+ "AND program.endtime > %1 "
"AND program.chanid = channel.chanid "
"GROUP BY starttime,endtime,channum,callsign "
- "ORDER BY program.starttime,%3 "
+ "ORDER BY program.starttime,%2 "
"LIMIT 500;")
- .arg(tr("Movie").utf8())
.arg(startTime.toString("yyyyMMddhhmm50"))
.arg(channelOrdering);
}
More information about the mythtv-dev
mailing list