Configuring Upcoming Recordings display

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Configuring Upcoming Recordings display

Post by cliveb »

When you go to "upcoming recordings" in myth front end, it has two options: "show all" and "show important".
I am 99.9% convinced that it used to be the case that when you switched the option, it was remembered and stayed that way.
But recently (and I can't say for sure when it started happening), it always pops up in "show all" mode.
I have to switch it to "show important" (which is my preference), and that choice is NOT remembered.
The weird thing is that I haven't changed anything.

Am I just imagining things?
Should changing the view mode in upcoming recordings be retained?
Is there some hidden-away setting I've not been able to find?
Perhaps I'm going mad.
(Using v0.31 if that's relevant).
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Configuring Upcoming Recordings display

Post by kmdewaal »

The setting should be persistent. It is present in database table settings with value ViewSchedShowLevel and data being then 0 for "All" or 1 for "Important". The value is written to the database when exiting the Upcoming Recordings display.
The code for this is in file programs/mythfrontend/viewscheduled.cpp and this is the part where variable m_showAll is retrieved and stored in database settiing ViewSchedShowLevel:

Code: Select all

ViewScheduled::ViewScheduled(MythScreenStack *parent, TV* player, bool /*showTV*/)
  : ScheduleCommon(parent, "ViewScheduled"),
    m_showAll(!gCoreContext->GetBoolSetting("ViewSchedShowLevel", false)),
    m_player(player)
{
    gCoreContext->addListener(this);
    if (m_player)
        m_player->IncrRef();
}

ViewScheduled::~ViewScheduled()
{
    gCoreContext->removeListener(this);
    gCoreContext->SaveBoolSetting("ViewSchedShowLevel", !m_showAll);

    // if we have a player, we need to tell we are done
    if (m_player)
    {
        emit m_player->RequestEmbedding(false);
        m_player->DecrRef();
    }
}
The variable m_showAll is then used elsewhere in the file to control what is shown.
This is all from the current master but v31 should be the same.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: Configuring Upcoming Recordings display

Post by cliveb »

Thanks for confirming that it should be retained - at least I know I'm not imagining things.
My myth system is based on prebuilt images, so I don't have the source to inspect.
But I guess I could take a look at the database to check - which table has this setting?

It's not a show-stopper, I can live with it as a very minor irritation
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Configuring Upcoming Recordings display

Post by kmdewaal »

After connecting to the database, e.g. with:

Code: Select all

mysql -u mythtv -p mythtv mythconverg
you can look at the value of ViewSchedShowLevel like this:

Code: Select all

MariaDB [mythconverg]> select * from settings where value='ViewSchedShowLevel';
+--------------------+------+----------+
| value              | data | hostname |
+--------------------+------+----------+
| ViewSchedShowLevel | 1    | kasus    |
+--------------------+------+----------+
1 row in set (0.001 sec)
The data is 0 for "All" or 1 for "Important". The value is updated when the "Upcoming Recordings" page is exited and you get back to the menu page.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: Configuring Upcoming Recordings display

Post by cliveb »

OK, now it's getting weird. I have three front ends, and here's the ViewSchedShowLevels:

Code: Select all

MariaDB [mythconverg]> select * from settings where value='ViewSchedShowLevel';
+--------------------+------+--------------------------+
| value              | data | hostname                 |
+--------------------+------+--------------------------+
| ViewSchedShowLevel | 1    | android-59ec289953d07e9b |
| ViewSchedShowLevel | 1    | mythfront                |
| ViewSchedShowLevel | 1    | mythtv-master            |
+--------------------+------+--------------------------+
3 rows in set (0.001 sec)
The Android front end is a full myth front end running on a FireTV Stick, and it behaves correctly.
"mythtv-master" is a front end running on the master backend (on a RPi4) and it too behaves correctly.
"mythfront" is a standalone front end on a RPi4 and this is the one that's not behaving. Every time I go to "upcoming recordings", it shows all the recordings, even though ViewSchedLevel for this front end is 1. If I exit "upcoming recordings" without switching to "show important" and then check again, the value in settings has changed to 0:

Code: Select all

MariaDB [mythconverg]> select * from settings where value='ViewSchedShowLevel';
+--------------------+------+--------------------------+
| value              | data | hostname                 |
+--------------------+------+--------------------------+
| ViewSchedShowLevel | 1    | android-59ec289953d07e9b |
| ViewSchedShowLevel | 0    | mythfront                |
| ViewSchedShowLevel | 1    | mythtv-master            |
+--------------------+------+--------------------------+
3 rows in set (0.001 sec)
If I go to "upcoming recordings" and switch to "show important" then exit, ViewSchedLevelis set to 1.
But then going back into "upcoming recordings", it shows all.

In other words, on this particular front end, even though EVERY instance of ViewSchedLevel in the database is set to 1, somehow it seems to think the value is 0.

One possible factor is that at some point I will have changed the name of the machine running the frontend, quite possibly after setting up mythtv front end on it.

Is it possible that when initialising the upcoming recording display, mythtv is for some reason trying to read the value using the old hostname? And when it then fails to find it, would it use a default value of 0?
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Configuring Upcoming Recordings display

Post by kmdewaal »

The settings logic is fairly complicated... If the database is not found then the 2nd parameter of the call to GetBoolSetting (line 3 of the code fragment) is used which is false and which translates to 0. However, if the database is not found then nothing should work.
You could check if the value for the LocalHostName in .mythtv/config.xml is what you expect it to be. The setting is stored with hostname mythfront so that is the name that I expect in config.xml.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: Configuring Upcoming Recordings display

Post by cliveb »

kmdewaal wrote:
Fri Sep 24, 2021 6:25 pm
You could check if the value for the LocalHostName in .mythtv/config.xml is what you expect it to be. The setting is stored with hostname mythfront so that is the name that I expect in config.xml.
Thanks.
Here's the content of config.xml:

Code: Select all

<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>192.168.0.10</Host>
    <UserName>mythtv</UserName>
    <Password>mythtv</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
  <UPnP>
    <UDN>
      <MediaRenderer>8bcf3336-70dc-4e0c-a1bc-1b109fb1a2ee</MediaRenderer>
    </UDN>
  </UPnP>
</Configuration>
I'm presuming that it's the value of <LocalHostName> that should be "mythfront"?
Funny thing is that when I checked config.xml on the master machine (mythtv-master), the value in <LocalHostName> was also "my-unique-identifier-goes-here", and the front end on that machine works just fine.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Configuring Upcoming Recordings display

Post by kmdewaal »

If you have specified a name in LocalHostName of config.xml then that value is used to identify your frontend in the database. If the LocalHostName is my-unique-identifier-goes-here then the actual hostname of the machine is used. I cannot reason it out completely but it could just be that changing the hostname on the frontend is related to your problem.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: Configuring Upcoming Recordings display

Post by cliveb »

kmdewaal wrote:
Sat Sep 25, 2021 10:20 am
If you have specified a name in LocalHostName of config.xml then that value is used to identify your frontend in the database. If the LocalHostName is my-unique-identifier-goes-here then the actual hostname of the machine is used. I cannot reason it out completely but it could just be that changing the hostname on the frontend is related to your problem.
The name of the machine (according to "uname -n") is indeed "mythfront", but it would seem that didn't do what was expected.
So I edited config.xml to set LocalHostName explicitly to "mythfront", and it's now working correctly.
I guess it remains a mystery as to why it didn't work before, but no matter - it's now sorted.
Thanks for all your help.
Post Reply