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

Ian Campbell ijc at hellion.org.uk
Fri Jan 6 13:18:37 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

FYI I don't see a comment from you there (last comment is #1 from Gary
2 years ago). Perhaps one more button click required?

>  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.

Maybe eventually things like xmltv and the metadata grabbers could
provide this "sort order" field alongside the normal name if the
datasource they are consuming includes it.

Ian.


More information about the mythtv-dev mailing list