Hitcher, thank you very much for your advice. It is appreciated. I can see the point now:
Media flags read
InfoLabels. But from the media file? Or the .nfo if it has already been created say by 3rd party app? I'm not a coder but I focus on languages.
To make thigs simpler, I will consider on the default Confluence skin and default list view.
File ViewsFileMode.xml is to be edited where within <itemlayout height="40" width="580"> and <focusedlayout height="40" width="580"> the following code should be added (Code from
Balrok's blog for skin Aeon Nox 5):
Code:
<control type="image">
<width>78</width>
<height>78</height>
<aspectratio>keep</aspectratio>
<texture background="true" fallback="flags/studios/default-studio.png">$INFO[ListItem.AudioLanguage,flags/language/,.png]</texture>
</control>
<control type="image">
<width>78</width>
<height>78</height>
<aspectratio>keep</aspectratio>
<texture background="true" fallback="flags/studios/default-studio.png">$INFO[ListItem.SubtitleLanguage,flags/language/,.png]</texture>
<visible>!IsEmpty(ListItem.SubtitleLanguage)</visible>
</control>
I assume the code above would read the meta-information from the media file (not the .nfo) and display the related language/subtitle icon. I should check relative paths and width/height dimensions for the icons to look good.
This approach seems to be adequate when dealing with media files with meta-information capabilities (mkv, mp4...). But,
what to do with media containers that do not keep such meta information?
Balrok points to a post in German in a
Kodi-related forum where the user freaks worth seems to grab the audio language informatiom from the folder or filename. The user is considering MediaListView3 in ViewsVideoLibrary.xml
Code:
<control type = "image">
<description> AudioIcon </ description>
<posx> 555 </ posx>
<posy> 143 </ posy>
<width> 20 </ width>
<height> 33 </ height>
<Aspect Ratio> Keep </ Aspect Ratio>
<texture> flagging / audio / eng.png </ texture>
<visible> substring (ListItem.Foldername, .EN) </ visible>
</ control>
control type = "image">
<description> AudioIcon </ description>
<posx> 555 </ posx>
<posy> 143 </ posy>
<width> 20 </ width>
<height> 33 </ height>
<Aspect Ratio> Keep </ Aspect Ratio>
<texture> flagging / audio / ger.png </ texture>
<visible>! substring (ListItem.Foldername, .EN) </ visible>
</ control>
In the case above I assume the English audio icon would be displayed always unless there is no .EN string when the audio icon would default to German.
Would this approach require adding an additional texture visible line for each language? Same language-name coding based on
3-character ISO 639-2 standard for the .png image
.EN .ES .FR .PT draw from the ISO 639-1 standard even though these could be simply renamed to .ENG .SPA .FRA .POR for consistency with the ISO 639-2 standard
For example:
Code:
<control type = "image">
<description> AudioIcon </ description>
<posx> 555 </ posx>
<posy> 143 </ posy>
<width> 20 </ width>
<height> 33 </ height>
<Aspect Ratio> Keep </ Aspect Ratio>
<texture> flagging / audio / eng.png </ texture>
<visible> substring (ListItem.Foldername, .EN) </ visible>
<texture> flagging / audio / spa.png </ texture>
<visible> substring (ListItem.Foldername, .ES) </ visible>
<texture> flagging / audio / fra.png </ texture>
<visible> substring (ListItem.Foldername, .FR) </ visible>
<texture> flagging / audio / por.png </ texture>
<visible> substring (ListItem.Foldername, .PT) </ visible>
<texture> flagging / audio / ita.png </ texture>
<visible> substring (ListItem.Foldername, .IT) </ visible>
</ control>
The goal, as it can be easily inferred is to get audio and subtitle language, both in meta-friendly and meta-unfriendly media files as well as internal and external subtitle files, to be displayed in Confluence
Please, feel free to add any suggestions, remarks... you or anyone wishes. They will all be welcome.