Project

General

Profile

Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH

Added by Delta Mike Charlie about 1 year ago

I have been working on a new feature to allow TVH to display ratings labels in addition to, or instead of, the current 'Age' field. Some sample screenshots are attached.

It is my opinion that users will be more accustomed to seeing the labels in their region, rather than just a number. (In Australia, the number is closer to the relative severity of the rating and is not strictly equated to the actual age stated in the rating definition.)

I would appreciate some user feedback, and potentially some help too, before finalising my design. Consequently, I am looking for:

1) Volunteers with a DVB test system or a production system that they are willing to play around with.
2) Volunteers that live in an area close to multiple rating jurisdictions or have a DVB-S service that covers multiple countries.

My new feature works by taking the country and age provided in the EIT parental_rating_descriptor and matching those to a rating label. In the future, it will also be able to work in reverse so that it can take a rating label via XMLTV and assign an age number. It will also be able to remap labels and ages to merge multiple rating systems if required.

Unfortunately, It was not just as simple as matching the age to a label in the language file as multiple regions that use the same language will use different rating systems (GB, AUS, NZ, CAN, USA, etc).

The new feature can learn from what is broadcast and save placeholder entries. The end user can then edit the placeholders to reflect the rating label required.

For example: I got a placeholder labelled 'AUS:11'. I know that this equates to 'PG' so I was able to assign that label. Likewise, somebody in Germany may see a placeholder of 'DEU:12' and change the label to read 'FSK 12' based on other EPG sources.

If I can accumulate enough samples, I may be able to pre-fill some data so that the placeholders can be created more accurately, requiring less (potentially no) user intervention.

I also plan to be able to add rating icons. The label is already in the JSON API and has been tested. It should be in the HTPS API too, however, that has not been tested yet.

Constructive thoughts and comments are welcome.


Replies (14)

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Jonas Lang about 1 year ago

An interesting feature but not of huge interest to me. Nice work though.

Now that we seem to have renewed interest in TVH development maybe it would be an opportunity to include a dedicated “New Feature” section in the forum.

People like yourself could respond to these requests indicating if these requests are actually feasible to implement or indeed if there’s enough interest among the user base to have these features included.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie about 1 year ago

Status Update

XMLTV rating matching is complete.

I have added the rating icon to the EPG information window.

The rating label and rating icon have been added to the HTSP API and the Kodi HTSP addon has been updated to get the rating label into the database. I now need to update the database schema to store the rating icon as well.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie about 1 year ago

Status Update:

  • The bulk of the coding is complete for TVH, Kodi and the Kodi/TVH addon.
  • Rating Labels now flow from the EPG to the scheduled recording to a complete recording. EPG and scheduled recordings maintain the ‘live’ rating label, however, once the recording is complete, the rating label is saved as-is for archiving purposes.
  • These 3 stages are also reflected in the Kodi EPG, ‘timer’ and ‘recordings’ screens.
  • The HTSP protocol has also been updated to accommodate rating label data for each of the 3 stages, as has the JSON API.

TVH and Kodi EPG event information.

TVH EPG with Rating Label

Kodi EPG details showing rating label

TVH and Kodi scheduled recording information.

TVH Scheduled recording showing rating label

Kodi timer list showing rating label

TVH and Kodi completed recording information.

TVH completed recording showing rating label

Kodi completed recording list showing rating label

Kodi completed recording detais showing rating label

I now need to perform a lot more testing with edge cases and also install from scratch to ensure that it works ‘out of the box’ rather than in my development environment. I also need to clean up the code and remove some debugging/informational functionality that I used during development.

The rating label icon URL path gets into Kodi and it can be displayed in the GUI, however, I still need to work out how best to display it in the ‘Estuary’ skin.

I would like to get this to work with ATSC and other DTV protocols, unfortunately, I do not have access to anything other than DVB and XMLTV.

01-TVH-EPG with Rating Label.jpg (28.6 KB) 01-TVH-EPG with Rating Label.jpg TVH EPG with Rating Label
02-Kodi EPG Details.jpg (46.3 KB) 02-Kodi EPG Details.jpg Kodi EPG details showing rating label
03-TVH-Scheduled with Rating Label.jpg (27.1 KB) 03-TVH-Scheduled with Rating Label.jpg TVH Scheduled recording showing rating label
04-Kodi Timers List.jpg (89.4 KB) 04-Kodi Timers List.jpg Kodi timer list showing rating label
05-TVH-Complete with Rating Label.jpg (26.9 KB) 05-TVH-Complete with Rating Label.jpg TVH completed recording showing rating label
06-Kodi Recording List.jpg (60.1 KB) 06-Kodi Recording List.jpg Kodi completed recording list showing rating label
07-Kodi Recording Details.jpg (45.4 KB) 07-Kodi Recording Details.jpg Kodi completed recording detais showing rating label

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie about 1 year ago

Examples of Kodi with rating icons. Both labels and icons are currently shown, however, a label will only be shown if an icon is not available.




RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Jonas Lang about 1 year ago

I’ve been following your progress on this topic and the effort you’ve put in to date is quite impressive.

From a personal point of view I feel it may have limited appeal to TVH users so I imagine testing all case scenarios may be quite difficult.

If you haven’t already done so, maybe a post in the Kodi forum might generate a little more interest and possible testers too.

No doubt it’s helping greatly with your knowledge of TVH/Kodi and believe me TVH could do with your input on other issues that need addressing in TVH.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie about 1 year ago

Jonas Lang wrote:

I’ve been following your progress on this topic and the effort you’ve put in to date is quite impressive.

Thanks for your feedback.

Jonas Lang wrote:

I imagine testing all case scenarios may be quite difficult.

My primary testing goal will be that of stability out-of-the box. I did manage to produce a great deal of instability during development/testing and I was able to address all of those underlying issues (mostly unexpected null pointers) as I encountered them.

The Rating Labels feature will be off by default, so if TVH does not crash (or cause any other problems) with rating labels disabled, then I count that as a win. I plan to build a .deb package and install that on a clean Ubuntu system and see what happens. Provided that my clean system is stable, I will then enable rating labels and see if anything breaks from there.

I may then create another clean system, install and run the latest public TVH for a while before then ‘upgrading’ to the new version and seeing what happens.

I also need to double-check that HTSP version protection is working everywhere. I don’t want an old version of a front end crashing because it gets an unexpected field. Especially if rating labels have been enabled and then disabled. I don’t want any residual data getting through.

Once rating labels are merged into the main release, I will basically go into bug fixing mode based on issues raised and comments received.

Jonas Lang wrote:

If you haven’t already done so, maybe a post in the Kodi forum might generate a little more interest and possible testers too.

As for enlisting Kodi users to assist with testing, that would be nice, but I’m not sure how practical that will be with TVH effectively not having officially released versions anymore. I’d have to publish my own unofficial version and hope that someone is willing to risk their system. Maybe I could make the .deb file available. I’ll think about it.

The Kodi community is also in the middle of a big discussion about how to handle rating icons going forward for Movies and TV Series (not live/recorded TV). This seems to have stalled and there are a number of people with a number of solutions and no apparent progress.

Jonas Lang wrote:

No doubt it’s helping greatly with your knowledge of TVH/Kodi and believe me TVH could do with your input on other issues that need addressing in TVH.

I also have 2 new features that I am thinking of adding to Rating Labels:

1) Legacy compatibility - This will just concatenate the rating label to the end one of the title/short description/extended description fields. Even if the front end does not support rating labels, at least the user will be able to see it.

2) Country code - Add the rating country code to the HTSP/JSON feed so that Kodi (or any front end) can make use of it if needed.

As for other areas:

I made a list, I'll need to look at it again. I'd also like to look into the XMLTV feed for updated entries. Currently, a programme can only be 'updated' if the start/end match the existing version. If the start/end move, then it is considered to be a new programme and the link to any scheduled recordings is lost. If the XMLTV feed has a unique identifier, that could be stored in the EPG database and used for matching updates.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Jonas Lang about 1 year ago

It’s been a while since we’ve seen that level of interest in TVH. There’s been a lot of inertia over the last couple of years and other than general maintenance builds nothing on the horizon. Ironic that you’ve mentioned Kodi as it appears to be suffering from its own inertia too.

I’ll keep watching your progress and hopefully you get this nailed.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie 12 months ago

I’ve done some testing and I’d like to see if anyone else can suggest any other tests before I submit this new feature for review. Most of these tests were performed on clean Ubuntu 22.04.1 VMs, cloned from an original clean VM for each test. Here is a summary of my tests and results:

TVH:
Upgrade plus a new installation. I followed the installation instructions from the wiki for a deb file and also created my own deb file from my development system to then install as an update.

Both resulted in rating labels being disabled by default as expected. Once RLs were enabled, everything appeared to work as expected.

HTSP:
I used my Python test script to connect via HTSP requesting various protocol versions. I saw only the expected fields associated with the requested protocol version.

Kodi:
I tried an older version of Kodi and it appeared to function correctly. I tried my updated (not published yet) version of Kodi plus pvr.hts addon and it too appeared to function correctly.

I tried 2 simultaneous Kodi versions, one old and one of mine with TVH-RL. I saw that both instances of Kodi were stable. I could schedule recordings from either Kodi and the recordings ended up on both as expected.

Even if the Kodi that scheduled the recording was not RL-enabled, TVH-RL saved the RL data and the Kodi-RL was able to see it, even though the non-RL Kodi could not. It should be noted that this only occurred when scheduling from the Kodi EPG screen.

Miscellaneous Findings:
Image cache does not seem to be enabled by default. This is needed for rating icons and is not hard to enable.

When installed from a deb file, TVH becomes a service. I had to edit the service definition file to include the “--noacl” instruction.

Because TVH is installed as a service, it did not have access to /home/{user} so I copied my ratings icons into /var/lib/tvheadend/ and they worked as expected.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Jonas Lang 12 months ago

Have you tried it on the alpha Omega version of Kodi. With a
- - noacl start your disabling access control. Is that correct. I wonder if you created your own Systemd service would it provide you with more flexible options. Just an observation.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie 12 months ago

Jonas Lang wrote:

Have you tried it on the alpha Omega version of Kodi.

The version of Kodi from which I created my fork was already Omega (v21).

/kodi-x11 --version
Kodi Media Center 21.0-ALPHA3 (20.90.301) Git:20230921-34bab8bb60-dirty
Copyright (C) 2005-2021 Team Kodi - http://kodi.tv

With a --noacl start your disabling access control. Is that correct.

Yes, '--noacl' removes the need to enter username/password every time that TVH is accessed via HTSP and HTTP.

Doing lots and lots of testing, it is much easier to bypass security. However, I did do one test with Kodi and passwords enabled just to make sure that it worked, and it did.

I wonder if you created your own Systemd service would it provide you with more flexible options. Just an observation.

I’m not sure that creating my own service would add that much flexibility. The existing service configuration is easy enough to modify.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie 12 months ago

In my ongoing testing, I managed to get rating labels working with TVH running as a LibreELEC module. However, I ran into an access control issue (caused by my use of '--noacl' during testing) and I would appreciate some feedback.

Currently, the ‘Ratings Label’ module requires an ‘Expert’ view level. Unfortunately, I can’t remember exactly why I selected the highest level of user proficiency.

The existing ‘Configuration -> Channel / EPG’ menus look like this:

Basic: Channels, Channel Tags, Bouquets, EPG Grabber
Intermediate: Channels, Channel Tags, Bouquets, EPG Grabber, EPG Grabber Modules
Expert: Channels, Channel Tags, Bouquets, EPG Grabber Channels , EPG Grabber, EPG Grabber Modules, Rating Labels

If I expect the user to modify the rating labels learned in their locale, then I think that it is reasonable to expect that the module will be visible to all users, not just expert users. Consequently, I’m thinking about changing the access level to ‘Basic’.

Comments welcome.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Dave Pickles 12 months ago

Modifying rating labels is not something I would expect the average user (or their children or grandchildren...) to do, so maybe one of the higher levels would be better.

RE: Adding Rating Labels ('PG', 'PG-13', 'FSK 12', etc) to TVH - Added by Delta Mike Charlie 12 months ago

Dave Pickles wrote:

Modifying rating labels is not something I would expect the average user (or their children or grandchildren...) to do, so maybe one of the higher levels would be better.

Thanks for your feedback Dave, it’s always helpful to have a sounding board.

I probably used to think that way and perhaps that is why I set the level to ‘Expert’ to start with.

However, as I stepped through the process of someone enabling and using the feature for the first time, it occurred to me that easier access may be more appropriate, at least in the early stages of development.

The feature is disabled by default, so the user will have to go into the ‘EPG Grabber’ tab to enable it. This tab and option are available in ‘Basic’ mode.

Once the feature is enabled, the user will start to see labels like ‘DVB:AUS:15’ appearing in their EPG. It will be up to the user to know that they need to modify, for example, ‘DVB:AUS:15’ to read ‘MA’.

It just seems counterintuitive that the feature can be enabled in ‘Basic’ mode, but that to make any meaningful use of the feature, the user needs to change to ‘Expert’ mode.

In a future iteration I hope to have a pre-defined ratings table (just like the existing pre-defined MUX tables) so that when TVH ‘learns’ a rating for the first time, it can do a lookup and save the appropriate label. The user will not have to do any manual intervention.

Provided that the ratings table covers enough regions, then the rating labels tab could be moved to ‘Intermediate’ as I suspect that having to select ‘Expert’ may intimidate some inexperienced users.

However, I would need a lot of real-world samples for this to happen and for now, I only have complete examples for Australian and German broadcasts. I also have a few incomplete samples from some countries that some kind TVH users sent me. Unfortunately, these samples were not comprehensive enough to build a global ratings table from.

I think that I’m going to stick with the change to ‘Basic’ and then reconsider moving to ‘Intermediate’ should I manage to obtain a greater sample set in order to create a pre-defined list.

    (1-14/14)