Original title from external EPG displayed by default

I noticed when multiple titles in EPG file are present, Channels takes original title (title lang=“xx”) by default and I can’t figure out how to force it to use a local title (title lang=“en”). Is this an expected behavior?

Here is an example programme:
<programme start="20210523180000 +0000" stop="20210523193000 +0000" channel="1040-sport">
<title lang="cs">WRC Vodafone Rally de Portugal - SS20 Fafe 2 WOLF PS</title>
<title lang="xx">Wrc</title>
<desc lang="cs">Záznam 4. podniku Mistrovství světa v rallye (Portugalsko).</desc>
<category lang="cs">Rally</category>
<icon src="https://www.o2tv.cz/img/epg/o2_sport_hd/29871818/profi_cover.jpg" />
</programme>

This lang=“xx” is common for WebGrab++ outputs, but it does not always contain useful information (like in the example above). It would be great if we could tell Channels to ignore the original title or simply display the original title as a second line item in the description.

There's no "en" in your example though?

It is a foreign TV station, so they usually provide two titles - original title (which is usually English, but could be any other language, so it’s typically tagged as “xx”) and local language title (in this case “cs”).

I thought changing “cs” to “en” would solve it, so I changed the EPG using a post-processing script, but even then Channels still picked up “xx” over “en”.

I see what you’re asking. I’m trying to display the title lang=“cs” tag by default. I should have clarified it in the original post.

Got it. The current behavior appears to be that the last entry wins. I will see if we can change this to use the first entry instead.

How about match the current OS language, and if there is no match, then use the first entry?

Do the other tags also have language variants, or only title?

I just skimmed through the XMLTV DTD, and this is what I found regarding the lang attribute. (Although, perhaps you aren't looking to fully implement the XMLTV spec?)

Under the channel element, the display-name element can take a lang attribute. As for the children of the programme element that can have a lang attribute:

  • title
  • sub-title
  • desc
  • category
  • keyword
  • language
  • orig-language
  • country
  • premiere
  • last-chance
  • review

It is extremely tedious to parse out every variation with our XML parser. I'm only looking to fix @tomx101's stated issue where he's getting the wrong title.

That particular issue should be fixed in v2021.05.27.0036. I've added a regression test on our side with the example in the first post.

2 Likes

Thank you for the quick fix! I just updated and confirmed that it fixed the issue. Thanks again.

1 Like