2020-11-20, 10:55 PM
This will be eventually make it to the wiki but I thought I'd start here to flesh out the steps involved in adding colour by genre to the NextPVR web and Kodi EPG. It should already work by default for DVB OTA and Schedules Direct guides.
This guide assume you can read English.
1. Locate the genre mapping table in the Program directory data folder called genre-mapping.xml.
Backup this file and work on the backup. I will call this the translation file.
2. Review the file the key values are the Standard DVB mappings at the beginning of the file. Colours are based on the type="" value.
3. Find the genres in your database that you want to map
I suggest using a sqlite tool suggest as sqlite3. To get this list try this
sqlite3 pathto/npvr.db3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite>.output genres.txt
sqlite>select genres, count(genres) as count from epg_event group by genres order by count desc;
sqlite>.exit
Then you should have a list of all your genres sorted by how often they occur.
4. Open the genres.txt file (I will call this the genres file) from step 3 and work from the top down, I leave it to you to determine how many you want to change some are pretty esoteric
For this example in the genre file I am using I found this
série d'animation|793
This I quickly match to "Cartoon/Puppets" in the translation file. Sometimes when it isn't clear it might help to look into the Schedules Direct mapping ("Animated") in the translation file
Using this inormation copy the existing line
<genre name="Cartoons / Puppets" type="80" subtype="5"/>
to the bottom of the backup of translation file and edit it with the text you want
<genre name="série d'animation" type="80" subtype="5"/>
5. Move down the genres file and repeat the update for the items you want in step 4
6. Once you are satisfied with the translation file save it ( you might want to save more often) Then you can verify the file by opening it in Firefox or chrome to make sure it is valid xml
7. With admin/sudo right rename your original genre-translations.xml to genre-translations.bak and copy in the translation file (as genre-translations.xml)
8. Restart the NextPVR server and check the guide in NextPVR web. This is important if you don't see it you won't see your changes.
9. If it works with the web browser it should work with Kodi.
Martin
This guide assume you can read English.
1. Locate the genre mapping table in the Program directory data folder called genre-mapping.xml.
Backup this file and work on the backup. I will call this the translation file.
2. Review the file the key values are the Standard DVB mappings at the beginning of the file. Colours are based on the type="" value.
3. Find the genres in your database that you want to map
I suggest using a sqlite tool suggest as sqlite3. To get this list try this
sqlite3 pathto/npvr.db3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite>.output genres.txt
sqlite>select genres, count(genres) as count from epg_event group by genres order by count desc;
sqlite>.exit
Then you should have a list of all your genres sorted by how often they occur.
4. Open the genres.txt file (I will call this the genres file) from step 3 and work from the top down, I leave it to you to determine how many you want to change some are pretty esoteric
For this example in the genre file I am using I found this
série d'animation|793
This I quickly match to "Cartoon/Puppets" in the translation file. Sometimes when it isn't clear it might help to look into the Schedules Direct mapping ("Animated") in the translation file
Using this inormation copy the existing line
<genre name="Cartoons / Puppets" type="80" subtype="5"/>
to the bottom of the backup of translation file and edit it with the text you want
<genre name="série d'animation" type="80" subtype="5"/>
5. Move down the genres file and repeat the update for the items you want in step 4
6. Once you are satisfied with the translation file save it ( you might want to save more often) Then you can verify the file by opening it in Firefox or chrome to make sure it is valid xml
7. With admin/sudo right rename your original genre-translations.xml to genre-translations.bak and copy in the translation file (as genre-translations.xml)
8. Restart the NextPVR server and check the guide in NextPVR web. This is important if you don't see it you won't see your changes.
9. If it works with the web browser it should work with Kodi.
Martin