EPG Genre mapping in XBMC
#1
Hi Guys,

I recently sorted out my EPG data and now want to use genre colouring - I use digiguide for my guide data so there is always a sensible set of genres (sitcom, comedy, film etc...) this is sent to XMLTV and imported to MePo.

Could someone explain how I map the genres to something usable by XBMC (I enabled reading of genres in the addon, and have a splash of colour here and there.. but most is still grey)

I looked at the genre_translation.xml file.. but don't understand how / what it's doing.. my strings are in english so i'm not sure if it's even needed, plus there is a default set of genres in Mediaportal TV Server, that I can map the XMLTV genres to, but I'm not sure what genres are even read by XBMC.

Anyone care to shed some light on this?
Reply
#2
I've been looking for ways to do this myself but so far no luck.

I look forward to learning this procedure also.



Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply
#3
Well I had a little unexpected time to look at this in the evening, and it's actually pretty straight forward.

You have to make a list of all the genre strings for your EPG data (this will vary depending on where you get it from) - You can also look at the program information within XBMC's guide data / Mediaportal EPG to see which genre is displayed.

Next you have to edit the genre_translations.xml file that is located in the resources folder of the mediaportal addon for XBMC.
You have to make an entry for each of your providers genre strings and map them to XBMC's genres (there is a list of the available genres in the XML file - I assume these are built into XBMC?)

Eg; <genre lang="en" type="0x70" subtype="0x06">film</genre>

So, in the example my provider (digiguide) sets all movies to the 'film' genre, now using the listing in the XML I map this to the main guide type, and then the sub type (excerpt from XML file below);

ARTSCULTURE 0x70 //without music <------- This is the 'main type' value
Subtypes:
PERFORMING_ARTS 0x01
FINE_ARTS 0x02
RELIGION 0x03
POP_CULTURE_TRAD_ARTS 0x04
LITERATURE 0x05
FILM_CINEMA 0x06 <------- Movies should map into this category, so the sub type I use is this one
EXPERIMENTAL_FILM_VIDEO 0x07
BROADCASTING_PRESS 0x08
.......

I seems you can map multiple strings to the same built in string (ie. if your provider uses both 'film' and 'movies' then you just add two lines - one for 'film' and one for 'movies' and set both to 0x70 0x06) then in XBMC both will be displayed as the 'Film/Cinema' genre and have the correct colouring.

Hope this helps!
Reply
#4
hey thanks a lot Swifty, I'll make this my project for tomorrow.

I appreciate you sharing the info and I'll let you know how it worked out for me.




Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply
#5
I tried editing the genre_translation.xml file by adding 1 line

<genre lang="en" type="0x10" subtype="0x09">sitcom</genre>

But it did not show up in the log:

DEBUG: AddOnLog: MediaPortal PVR Client: Opened C:\Program Files (x86)\XBMC\addons\pvr.mediaportal.tvserver\resources\genre_translation.xml to read genre string to type/subtype translation table
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'movie/drama (general)' => 0x10, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'detective/thriller' => 0x10, 0x1
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'comedy' => 0x10, 0x4
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'soap/melodram/folkloric' => 0x10, 0x5
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'adult movie/drama' => 0x10, 0x8
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'news/current affairs (general)' => 0x20, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'documentary' => 0x20, 0x3
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'show/game show (general)' => 0x30, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'sports (general)' => 0x40, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'childrens's/youth program (general)' => 0x50, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'cartoon/puppets' => 0x50, 0x5
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'music/ballet/dance (general)' => 0x60, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'arts/culture (without music, general)' => 0x70, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'religion' => 0x70, 0x3
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'magazines/reports/documentary' => 0x80, 0x1
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'education/science/factual topics (general)' => 0x90, 0x0
DEBUG: AddOnLog: MediaPortal PVR Client: Genre 'nature/animals/environment' => 0x90, 0x1

I continue to get this error:
DEBUG: AddOnLog: MediaPortal PVR Client: EPG: No mapping of 'Sitcom' to genre type/subtype found.

Any advice?


Reply
#6
0x10, 0x09 doesn't appear to be a valid genre type (well, it's not there in the version I have anyway..)

I *think* that you can only use the hex values that are listed (ie. these the genres supported by XBMC internally) so you basically use the genre_translations.xml file to map your 'sitcom' genre to one of the supported ones.
Try to change the line you added to something like 0x10,0x04 - that should map your 'sitcom' genre to the 'comedy' genre supported inside XBMC.

I would be good if anyone could shed some clarity on this, as I'm mostly guessing at this and the list in the file suggests it's not entirely complete, but it seems to be working for me (well it would be if I could actually write the file somewhere in Openelec!)
Reply
#7
Thanks. I tried your suggestion without any success. No matter what I add, the same info shows up in the debug log. I even deleted everything but 2 lines and all the genre info listed above shows up. When I remove the file it does log that the file was not found.
With the original file the only color coding in my EPG is comedy. Maybe it is a RC2 thing.
Reply
#8
Finally got it to work. Not sure if what I did was correct, but I now have Genre Colors.
I found genre_translation.xml in 2 locations.
C:\Program Files (x86)\XBMC\addons\pvr.mediaportal.tvserver\resources
C:\Users\Me\AppData\Roaming\XBMC\addons\pvr.mediaportal.tvserver\resources
So I edited them both, refreshed my PVR DB, but the old values continued to show up in the log. I stopped and started my MediaPortal server. Still no luck.

It wasn't until I copied genre_translation.xm from C:\Users\Me\AppData\Roaming\XBMC\addons\pvr.mediaportal.tvserver\resources to C:\Program Files (x86)\XBMC\addons\pvr.mediaportal.tvserver\resources that it worked. (Even though the files were exactly the same). I have since made some edits and had to do the same thing.

On my XBMCBuntu box all I had to do is update /usr/share/xbmc/addons/pvr.mediaportal.tvserver/resources/genre_translation.xml, refresh the PVR DB, and it worked.

Weird.

The MediaPortal TV-Server Configuration tool allows you to edit the Genre info, but that does not seem to flow into XBMC. It would be nice if it did.


In the end I added these values. (I could probably add a ton more according to my DB)

<!-- detective/thriller //-->
<genre lang="en" type="0x10" subtype="0x01">crime</genre>
<genre lang="en" type="0x10" subtype="0x01">crime drama</genre>
<genre lang="en" type="0x10" subtype="0x01">reality</genre>

<!-- adult movie/drama //-->
<genre lang="en" type="0x30" subtype="0x08">action</genre>
<genre lang="en" type="0x30" subtype="0x08">adventure</genre>
<genre lang="en" type="0x30" subtype="0x08">suspense</genre>

<!-- news/current affairs (general) //-->
<genre lang="en" type="0x20" subtype="0x00">news</genre>

<!-- magazines/reports/documentary //-->
<genre lang="en" type="0x80" subtype="0x01">newsmagazine</genre>
<genre lang="en" type="0x80" subtype="0x01">talk</genre>
<genre lang="en" type="0x80" subtype="0x01">entertainment</genre>

<!-- movie/drama (general) //-->
<genre lang="en" type="0x10" subtype="0x00">drama</genre>

<!-- comedy //-->
<genre lang="en" type="0x10" subtype="0x04">comedy-drama</genre>
<genre lang="en" type="0x10" subtype="0x04">romance-comedy </genre>
<genre lang="en" type="0x10" subtype="0x04">sitcom</genre>

<!-- sports (general) //-->
<genre lang="en" type="0x40" subtype="0x00">sports event</genre>
<genre lang="en" type="0x40" subtype="0x00">sports non-event</genre>
<genre lang="en" type="0x40" subtype="0x00">sports talk</genre>
Reply
#9
Can you show a screenshot of what the epg looks like now? I'd like to maybe use your values..

Thanks.
Reply
#10
Has anyone come up with a solid formula for getting EPG colors to display properly?

I've tried a few and I'm almost certain it depends on where you're getting your EPG data.

I noticed better results when using data from schedules direct than data from Microsoft EPG data source.

Any thoughts?



Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply
#11
Maybe I misunderstand you Hoops, but I don't think it matters where you get your EPG data. The completeness of EPG colors just depends on you modifying the genre_translation.xml. If you have added all possible genre descriptions that your data is using... then all of your programming will be colored.
Reply
#12
Anyone willing to share their genre_translation files?

Here's mine:

https://www.dropbox.com/s/4x39agmxsis9a5...lation.xml

I'm thinking maybe if we try or look at different files we'll get closer to what we really want.

One issue I'm having is getting "Horror" to show color. Also my drama tv shows are showing "adult movie/drama"
NHL and Golf refuse to show sports color



Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply
#13
Short answer is you cannot add new genres. You can only map (translate) the ones you get from your EPG provider to the ones that are hard-coded into XBMC.

For example, golf isn't working because 0x0H doesn't exist... I think I mapped mine to 0x00 so it just says Sporting Event.

It took me a long time to get my head around how it worked... I had given up on 2 previous occasions.

Tommy

I'll install Drop Box and upload mine. I am using schedules direct so ours should be the same
Reply
#14
(2013-08-27, 18:19)t-magnus Wrote: Short answer is you cannot add new genres. You can only map (translate) the ones you get from your EPG provider to the ones that are hard-coded into XBMC.

For example, golf isn't working because 0x0H doesn't exist... I think I mapped mine to 0x00 so it just says Sporting Event.

It took me a long time to get my head around how it worked... I had given up on 2 previous occasions.

Tommy

I'll install Drop Box and upload mine. I am using schedules direct so ours should be the same

OK, that makes since, so if I was to do this, with golf, I should be good:
<genre lang="en" type="0x40" subtype="0x00">golf</genre>

I'm not using schedules direct right now I'm using "Microsoft" but I have noticed you get better details with SD than microsoft.



Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply
#15
Looking forward to comparing our files

Thanks in advance



Office: Google TV | Kodi 20.0 | Samsung 50"                         \  Movies: 2734
Master Bedroom: Google TV | Kodi 20.0 | Samsung 43"     \  Music: Artist 220 |  Albums 1001 | Songs 106995
TheaterGoogle TV | Kodi  20.0 | Samsung 75"                    \  TV Shows: 62 |  Seasons 218 | Episodes 3858
-----------------------------------------------------------------------------------------------------
 
Reply

Logout Mark Read Team Forum Stats Members Help
EPG Genre mapping in XBMC0