Add audio and subtitle details to Film Info Screen
#1
Hello eveybody,

I'd like to add audio and subtitle details to the Film Info screen. In the details box on the lower right of the screen there are a few rows that contain info that is useless to me (studio, first screened, date added), I'd like to replace these with audio stream languages and subtitle languages (internal and external). Yatse displays these infos, so how can I get them on here?

I have seen an older thread that tried to add these info as flags (next to the resolution etc. flags), but this would only display one audio and one subtitle language; since most of my movies have multiple of those I'd like to have all the options displayed.

Thanks in advance,
vonson
Reply
#2
If you want to customize this section, feel free: 

https://github.com/xbmc/xbmc/blob/master...#L156-L259

Check those info labels and choose those you want to replace: 

https://kodi.wiki/view/InfoLabels#ListItem

There's :
ListItem.SubtitleLanguage
ListItem.AudioLanguage
ListItem.AudioChannels

Not sure if external subtitles is working and how yatse is able to check for an external file next to the movie file. Maybe Kodi does that internally. But you can change those info labels as much as you like until it matches.
Reply
#3
Hey, thanks for your reply. That surely is helpful, I should be able to get this to work. However, It will still only display the first language if i understand this correctly. Is there any way to have it collect all available languages and display those? Like:  

Audio:  de, en
Subtitles: de, en

or, even nicer:

Audio:  German, English
Subtitles: German, English

As I said, Yatse does this, so it seems to be possible, and it surely would be very useful information, I'm actually surprised this is not requested frequently...
Reply
#4
Davu actually point out the wrong infolabels for what you want, further down the wiki page you'll find:

ListItem.Property(AudioLanguage.[n])
ListItem.Property(SubtitleLanguage.[n])

where n is a number.

So for example for a video that has 3 Language tracks you need:

ListItem.Property(AudioLanguage.1)
ListItem.Property(AudioLanguage.2)
ListItem.Property(AudioLanguage.3)

So to be able to display all tracks you need to work out what is the maximum number of tracks any of your files contain.

There are skins that will show the languages where multiple subtitle tracks exist (not sure about lanuages) in their movie info dialog, although I can't remember which ones off the top of my head.
Reply
#5
I covered this previous here https://forum.kodi.tv/showthread.php?tid=360290
Reply
#6
Ha...I simply took the first I found Wink

Very true. to list multiple languages just do what @jjd-uk said Wink
Reply
#7
Hello everyone, I was away for a few days so I just saw the new replies. I will have to have a serious look into this, from first glance it sounds promising.
I am not very versed with python so it will take me some time and a lot of experimenting, but I will report back.

Thanks to everyone. This is such a nice forum.
Reply
#8
This has nothing to do with python at all. This is only about editing xml-files
Reply
#9
So, finally I found the time to try this out and indeed it works like a charm.
It shows only the 3-character language codes (eng, ger) instead of full language names (English, German); probably not quite as nice, but allows for more info to be included in case of multiple entries., so that is OK for me

One thing that I still do not understand is the $LOCALIZE[xxxxx] part. I understand these look up the value somewhere to insert the localized term, but where these are stored and how I would add my custom values there I do not know. It's not really important since it's for my personal usage and thus won't be needed, but I'm curious...


Anyway, thanks everyone for all the help.
Reply
#10
It would be possible to fix that by using a Variable, but it would need a lot more code.

So ListItem.Property(AudioLanguage.1) could be replaced by $VAR[AudioLanguage1Var]

Then in Variable.xml define

xml:
<variable name="AudioLanguage1Var">
<value condition="String.IsEqual(Property(AudioLanguage.1),eng)">English</value>
<value condition="String.IsEqual(Property(AudioLanguage.1),ger)">German</value>
</variable>

So String.IsEqual does a match on what is return by Property(AudioLanguage.1) then what is place after comma is what it tries to match to.

then you need to repeat this for

ListItem.Property(AudioLanguage.2) to AudioLanguage2Var
ListItem.Property(AudioLanguage.3) to AudioLanguage3Var
etc

Then also do similar for subtitles. So the amoiunt of code & work can very quickly snowball.

As for $LOCALIZE[xxxxx]

These are found in the strings.po files. In the system addon folder there is the resource.language.en_gb addon that is shipped with Kodi.
Then Userdata addons folder will contain any other lanuages installed.

These are the lanuage strings returned by the core application.

Then the skin as an addon canhave it's own strings.po file so within the addon folder there is a language folder then resource.language folders for each language which contains the relevant strings.po
Reply
#11
Hey, thanks. Interesting.

For the LOCALIZE issue: I regard this as 'good to know', but for now it seems to me that it is not worth the hassle, since it is for my personal use only.


As for the language-code conversion:

I might have a look into it, but I regard this low priority. There are a lot of different languages in my movie collection, and to have it repeated for each language number seems overkill...
However, just to understand it: This methon runs a bunch of IsEqual routines on defined results. To me it seems that if it does not find a match it would return nothing? Wouldn't I need to include something like
<value=Property(AudioLanguage.1)</value>
or something else like it to avoid an empty result? I'd prefer that it would return the three-character code in this case.

And wouldn't it be possible to have one single language-matching code routine that can be accessed for each Property(AudioLanguage.x) and Property(SubtitleLanguage.x) instead of having to repeat all of it for each one of those?
Reply
#12
To avoid an empty result then that would be

xml:
<variable name="AudioLanguage1Var">
<value condition="String.IsEqual(Property(AudioLanguage.1),eng)">English</value>
<value condition="String.IsEqual(Property(AudioLanguage.1),ger)">German</value>
<value>ListItem.Property(AudioLanguage.1)</value>
</variable>

So it works from top to bottom, so the bottom value would be the fallthrough if it can't match using the condition values, in this case returning the the 3 letter code.
Reply
#13
(2022-02-09, 16:23)vonson Wrote: And wouldn't it be possible to have one single language-matching code routine that can be accessed for each Property(AudioLanguage.x) and Property(SubtitleLanguage.x) instead of having to repeat all of it for each one of those?

Ha..ha..this why I never mentioned it before today as yes it's a lot of extra effort. If there was a shortcut then I'd have said, that's not to say something wouldn't be possible just that nothing occurs to me currently, but if anything occur to me I'll put an update here.
Reply
#14
Smile  That's what I expected when you proposed the jarring multiple-code way.

Nevermind, I'm quite happy as it is, a nice addition of actually quite useful info (that I'm surprised not more people feel should be there...).

And btw: External subtitles are included in the info.


Again, thanks a lot to eveyone.
Reply
#15
Hello again,

I'm still quite happy with the modification, now I thought about another little tweak on the info-screen, this time concerning the Extras-addon:

I'd like to have among the buttons (Play, Trailer, Personal Rating, Extended Info etc...) one for Extras. I know the Extras-addon adds a context-menu item, but I find that not ideal.
Is it possible to add a button (or replace one of the existing ones) to access the Extras? Even better, have it show only if Extras are present, otherwise have it hidden or inactive?

Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
Add audio and subtitle details to Film Info Screen0