[mythtv-commits] Ticket #1678: mythvideo sorting is case-sensitive
MythTV
mythtv at cvs.mythtv.org
Sun Apr 23 07:32:08 UTC 2006
#1678: mythvideo sorting is case-sensitive
-------------------------------+--------------------------------------------
Reporter: thomas at boerkel.de | Owner: awithers
Type: patch | Status: new
Priority: minor | Milestone:
Component: mythvideo | Version: 0.19
Severity: low | Resolution:
-------------------------------+--------------------------------------------
Comment (by sphery <mtdean at thirdcontact.com>):
Updated patches (*-mythvideo-titlesortkey_in_database.patch). As
described at http://www.gossamer-
threads.com/lists/mythtv/dev/199541#199541 , this patch modifies
!MythVideo to use a user-specifiable title-sort key that's stored in the
database (per JDS's suggestion in the comment he added above the existing
sort code). To support the new title-sort key, the patch makes the
following changes:
* Updates the DB schema and adds a column, titlesortkey, to the
videometadata table of the database (the column is 256 characters--2x the
size of the title column--to allow the user to specify secondary or
tertiary sort keys as desired (within reason))
* Creates a default "guess" value for titlesortkey (using the current
value of title with initial indefinite articles removed)
* Removes all in-application sorting code (now that sorting is done by
the database)
* Adds an editable text box for "Title-Sort Key" to the "Edit Video
Metadata" screen
* Updates all themes to support the new titlesortkey (the only changes in
myththemes-mythvideo-titlesortkey_in_database.patch mythtv-mythvideo-
titlesortkey_in_database.patch are theme updates)
* Automatically guesses the titlesortkey when a new video is found during
scan, when metadata is reset, when an IMDB movie data search is performed,
or when metadata is written to the database with no value for titlesortkey
* Changes all usage of the title sort (kOrderByTitle) to use the
titlesortkey (this includes the Video Manager, so sorting will be
consistent in all places within !MythVideo)
Although the "guess" is not lower-case, since MySQL performs case-
insensitive sorts, the patch fixes the issue in this ticket by moving the
sorting back to MySQL
The SQL UPDATE in dbcheck.cpp should work for all supported versions of
MySQL. It trims the initial indefinite articles from titles to create the
titlesortkey using the translated value of the "indefinite articles regex"
to ensure the initial titlesortkey are correct--even for non-English
speakers.
The "guessed" value of titlesortkey does not include any secondary (or
tertiary) sort keys. Therefore, a user who has multiple videos differing
only in initial articles and/or case may choose to append additional key
information to the titlesortkey to specify an order for these like-named
videos. If the "guessed" value is used, the like-named videos will appear
in the order they were added to the database (from oldest to newest),
which is a reasonable default.
Users wanting "custom" sorting may either edit the "Title-Sort Key" via
the GUI or may use SQL to update the titlesortkey column for multiple
videos with a single command.
Note that the titlesortkey is only used when the user sets the view to be
sorted by title (kOrderByTitle).
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/1678>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list