[mythtv] Ignore 'The|A|An' prefixes when sorting video directories

David Hampton mythtv at dhampton.net
Fri Jan 6 16:29:53 UTC 2017


On Fri, 2017-01-06 at 13:02 +0000, mythtv at phipps-hutton.freeserve.co.uk 
wrote:
> Quoting David Hampton <mythtv at dhampton.net>:
> 
> > P.S. I know there's bug report (#12298) that says that sorting
> > should
> > never ignore prefixes. I was thinking that an exception list would
> > solve the reported problem (i.e. don't strip prefixes from the
> > string
> > "A to Z") while stripping prefixes for the normal case. I was
> > considering this as a follow-on project, although passing a list of
> > strings into the various sorting functions seems messier than the
> > current code that only passes a single boolean.
> > 
> 
> I've added a comment to #12298 that outlines a way to fix this.  
> Basically it punts the problem outside of the MythTV code by adding
> an extra field to the database that is used for simple sorting. The
> extra
> field should be copied from the title and then it can be manipulated 
> by a script to remove the prefixes and all the complexity of what to 
> remove and what not to remove can be in one place and it only has to 
> run once per show rather than every time a list is produced.

I like the idea of having a title and a "sort title" in the database
and that would cleanly handle a number of problems, but it doesn't
address my initial problem of directory sorting. I know I could just
rename my directories to force a sort order, but doing that triggers a
different bug where the renamed directories never show a cover image
(presumably because they don't match anything in the database).  I end
up having to add a folder.jpg icon into each renamed directory to get
them to display properly.

David



More information about the mythtv-dev mailing list