"Change Group Filter" suddenly unsorted?

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
wmorrison
Senior
Posts: 129
Joined: Sat Dec 01, 2018 12:05 am
United States of America

"Change Group Filter" suddenly unsorted?

Post by wmorrison » Thu Aug 27, 2020 3:38 am

On "Watch Recordings" press M and choose "Change Group Filter"

The list that appears has always been

All Programs
--- Groups ---
Default
Deleted
[MY CUSTOM GROUPS SORTED ALPHABETICALLY]
--- Categories ---
[ALPHABETICAL CATEGORIES]

Suddenly, my groups appear in "random" order. At first I thought it was a glitch but it's survived several boots.

Actually, my custom groups are at the top under --- Groups --- in the order of recgroups.recgroupid, then under that is Default and then Deleted.

How did this happen? Is there a setting for this I can't find?

User avatar
bill6502
Developer
Posts: 1722
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: "Change Group Filter" suddenly unsorted?

Post by bill6502 » Thu Aug 27, 2020 7:55 pm

What little I know:

Mine Groups sort OK, but I only have 1 "CUSTOM" group.

It's ------- Groups ------- (seven, not three dashes, at least in master).

The query involved seems to be: SELECT recgroup,COUNT(title) FROM recorded WHERE deletepending = 0 AND watched <= 0x800 GROUP BY recgroup; (I could be wrong about the watched value. And, it appears that this was never converted to use
the recgroups table.)

This setting is involved, my value is 32,809 or 0x8029:

curl --header Accept:application/JSON localhost:6544/Myth/GetSetting?Key=DisplayGroupDefaultViewMask\&HostName=<your frontend hostname>

and the enumeration is here: https://code.mythtv.org/cgit/mythtv/tre ... kbox.h#n84

The method is here: https://code.mythtv.org/cgit/mythtv/tre ... .cpp#n4544

That's about all the time I've got. Have fun.

wmorrison
Senior
Posts: 129
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: "Change Group Filter" suddenly unsorted?

Post by wmorrison » Fri Aug 28, 2020 4:17 am

Bill, I ran the query you posted, and it returns results in the same order they are appearing on my "Change Filter" popup, which is also the same as the order of recgroups.recgroupid, except with Default and Deleted at the bottom. Even though the query doesn't use the recgroups table.

That query has no "order by". How does it know to move Default and Deleted to the end? It's got to be something about how mythconverg is set up? I'm not an expert at MySql. I can write queries but that's about it. I use Oracle at work.

I did just do an apt update on 8/25 and there were some myth libraries updated, including mythtv-database. Possible some database change/optimization was made that broke sorting?

User avatar
pgbennett
Developer
Posts: 362
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: "Change Group Filter" suddenly unsorted?

Post by pgbennett » Fri Aug 28, 2020 1:30 pm

I have found that generally mysql by default seems to return records in the order they were created, so that would be the order you used the groups for recordings. However, "group by" may change that.

Probably the reason it does not use the record group table is that you may get recording groups that have no recordings. Selecting one that has no recordings would leave your frontend in a strange state.

wmorrison
Senior
Posts: 129
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: "Change Group Filter" suddenly unsorted?

Post by wmorrison » Sat Aug 29, 2020 3:59 pm

All I know is, my recording groups were sorted alphabetically (except Default and Deleted) a few days ago, I liked it that way, and now it's not. I am absolutely sure they were sorted because I use this feature every day.

I see the query in PlaybackBox::showGroupFilter does not "order by" and the code does not sort it, and when I run it in DBeaver I get the same order as shown in MythTV, so somehow the "natural order" of this query changed recently.

I also see in PlaybackBox::ShowRecGroupChanger a query that does join with recgroups, and does order by recgroup. So maybe the solution is to update the query in PlaybackBox::showGroupFilter to be similar.

However, I am not set up for MythTV development to do this myself. I have too much coding at work to get into this now and don't want to break my MythTV system. I can live with the unsorted list, it's just annoying.

User avatar
pgbennett
Developer
Posts: 362
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: "Change Group Filter" suddenly unsorted?

Post by pgbennett » Sun Aug 30, 2020 1:21 pm

I have a feeling that many people do not use recording groups. I do use them a lot. However, for changing the current view group I just use the "," and "." keys, or the forward skip and back skip on the remote. The list of groups shown on screen for the skip keys is sorted, unless you are using a theme that does not show the groups. I use Steppes and the groups are alphabetically arranged along the top.

The only time I use the "change group filter" is to see one of the hidden groups, "Live TV" or "Deleted".

Post Reply