[mythtv] Consolidate all 'The|A|An' prefix handling
David Hampton
mythtv at dhampton.net
Wed Feb 1 14:44:36 UTC 2017
Here's a description of my second take on a patch that began with a
desire to ignore the 'The|A|An' prefixes when sorting directory
names. I've enlarged the scope of the patch to consolidate almost all
instances of removing prefixes as part of sorting. The attached patch
for 0.28 will:
1) Add a boolean setting for whether or not sorting of
video/recording names should be case sensitive.
2) Add a boolean setting for whether or not to strip 'The|A|An' from
the start of video/recording titles, filenames, and directory
components.
3) Add a text setting for an exclusion list to prevent stripping
prefixes from the specified strings. Strings to be excluded are
separated by a semicolon. This should handle issue 12298 where the op
has a show named 'A to Z'.
4) Create a new class to consolidate all sorting related variables
and functions.
5) Convert almost all locations in the video/recordings code to use
this new class. The 'Program Finder' is unchanged as it uses customized
sql queries, and doesn't strip the prefix but moves it to/from the end
of the string.
6) Add a call to the new class when sorting video directory names.
This fixes my original problem (issue 12961).
I have uploaded the diffs to https://pastebin.com/JiviPCuF
I would appreciate any comments on the coding and whether it fits into
the MythTv style. I'm a long time C programmer, and familiar with svn
and older source code control systems. I'm still learning about git,
GitHub, Trac, etc, so please let me know if I should be doing something
differently. I can (figure out how to) rebase the patch to be off trunk
if needed.
David
More information about the mythtv-dev
mailing list