[mythtv-users] Bug related to ignoring the and a in title ordering

David Hampton mythtv at love2code.net
Sun Mar 19 20:00:09 UTC 2023


On Sun, 2023-03-19 at 12:48 +0100, Hika van den Hoven wrote:
> Hoi David,
> 
> Sunday, March 19, 2023, 5:41:05 AM, you wrote:
> 
> > On Sun, 2023-03-19 at 05:11 +0100, Hika van den Hoven wrote:
> > > Hoi Stephen,
> > > 
> > > Sunday, March 19, 2023, 3:43:51 AM, you wrote:
> > > 
> > > > On Sun, 19 Mar 2023 00:47:31 +0100, you wrote:
> > > 
> > > > > Hoi All,
> > > > > 
> > > > > I encountered an annoying bug. I am still on 0.27 so don't
> > > > > know
> > > > > if it
> > > > > still exists, but I guess it does.
> > > > > In my recordings I have a movie "Dark Heart".
> > > > > Currently there is a running series called "The Dark Heart"
> > > > > or
> > > > > actually "Mörkt Hjärta" but it is running under the English
> > > > > translated
> > > > > name.
> > > > > If I select "List Recorded Episodes" nothing happens.
> > > > > On going there the long way I saw I have in my recordings a
> > > > > movie
> > > > > called "Dark Heart".
> > > > > So my guess is the names with and without "The" are not
> > > > > consistently
> > > > > used in coding. I do not see any error in the log.
> > > 
> > > > I met this problem a year or two ago, and I discovered that
> > > > there
> > > > is
> > > > an option to turn off the ignoring of "The".  But I can not
> > > > remember
> > > > exactly where it is.
> > > 
> > > Does anybody know!
> 
> Setup ->> General -> General -> Remove Prefixes when Sorting (*)
> 
> > MythTV never actually removes the prefix from the title, it just
> > ignores the prefix when sorting names.  It sounds like something
> > else
> > is going on that is causing "Dark Heart" and "The Dark Heart" to be
> > confused.
> 
> > David
> 
> > * That label needs to be updated to "Ignore Prefixes when Sorting".
> > The
> > description also needs to be updated.
> 
> Thanks.
> Either that option was added after 0.27 or it is not present in
> MythCenter-wide. On the indicated page I only have "Use line edit
> virtual keyboard" and "Screen shot path"

You're right. I just checked this morning and my rework of the sorting
code went into 0.30.

I've been looking at the patch from 2017 that changed sorting, I don't
see any removed option related to sorting, only the added one I
mentioned before. I don't think you could disable the prefix ignoring
code before 0.30.

I also started digging into the code and I've found the problem.  Its a
little complicated though.  When creating the Watched Recordings page:

1) Each entry in the group list has a sorting name and a display name.
For your listings this might be a sort name of "Dark Horse" and a
display name of "The Dark Horse".

2) The group list enforces unique sort names.

3) Recordings are added to a group based upon their sort name.

4) The "List Recorded Episodes" action looks up the title of the
currently selected program in the group list based on its display name,
and switches to that group.

Putting these things together, here's what happens. When the watch
recordings page is created, because "Dark Horse" and "The Dark Horse"
have the same sortable title only one entry gets created in the group
list. Whether the display name for that group is "Dark Horse" or "The
Dark Horse" depends upon the order that the programs were returned from
the database. Lets assume that the display name is set to "The Dark
Horse". When you go into "All Programs" group and choose a program
named "The Dark Horse" and select "List Recorded Episodes", the name is
successfully looked up in the group list and MythTV will switch to that
group.  If, however, you  choose a program named "Dark Horse" and
selected "List Recorded Episodes", that name cannot be found in the
group list (because the display name there is the "The Dark Horse") so
the display doesn't switch.

I can recreate this problem in the latest code. Disabling the "Remove
Prefixes when Sorting" option solves the problem in the latest code. In
this function in 0.27 however, stripping the article prefixes when
creating the sort names is hard coded and can't be disabled.

I'm filing an issue report now to fix this in the latest code.

David



More information about the mythtv-users mailing list