Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
InfoLabel parsing help
#1
im trying to extract info from a file name to populate a infolabel

File name:
10 Cloverfield Lane (2016)_Atmos.HDR10.(50.3 Mbps).(43.20 G).mkv

i would like to use VideoBitRate 50.3 Mbps and FileSize 43.20 G in my skin, but i can't seem to figure out how to parse the info?
Reply
#2
ListItem.Size but bitrate for movies isn't available.

https://kodi.wiki/view/InfoLabels#ListItem
Reply
#3
ListItem.Size returns “0 b”

Thats why i want to parse the file name to pull the info, just need to know how to parse just those sections of the file name
Reply
#4
I think one inefficient way to do this would be with variables and String.Contains. But that would require you to change your format so there would be a way to identify which number is which and you'd need hundreds of lines....

xml:

<variable name="File_Size">
<value condition="String.Contains(ListItem.filename,FileSize.50.3G)">50.3G</value>
<value condition="String.Contains(ListItem.filename,FileSize.50.2G)">50.2G</value>
<value condition="String.Contains(ListItem.filename,FileSize.50.1G)">50.1G</value>
...

You could make it easier by rounding your filenames to the nearest GB if you didn't want to do every decimal. But again, that would involve renaming your files.

The bigger problem with this is that it's non standard info typically not included in filename formats so if you were doing this for other people to be able to use, it's dead in the water.

If this is just a personal mod, you might be able to get away with editing your .nfo XML files and using a field you don't need that Kodi can read from, then just putting the info you want Kodi to show in there.

Again, not a great solution and probably terrible advice, but at least viable for a personal mod. With combination nfos you can even stop scrapers from overriding just these fields that you manually enter

https://kodi.wiki/view/NFO_files/Combination

This is one of mine where I wanted to control MPAA, studio and set, but for the scraper to do the rest. You just put the direct tmdb link after the </movie> tag

xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<movie>
<sorttitle>Spider-Man 8</sorttitle>
<mpaa>12A</mpaa>
<playcount>1</playcount>
<lastplayed>2022-3-26</lastplayed>
<set>
<name>Marvel Cinematic Universe, Phase 4</name>
</set>
<studio>Columbia Pictures</studio>
</movie>
https://www.themoviedb.org/movie/634649-...o-way-home

Either way, it's going to be a lot of work to do it.

I would also have a look at your video files if ListItem.size isn't working. That should work.
Reply
#5
I use TMM for metadata management, so adding file size and bitrate is very easy. And yes this is a personal mod.

Does ListItem.Size work for you? All my files are.mkv
Reply
#6
You'd probably need to add the info into a pre-existing field you're not interested in so that Kodi has a corresponding infolabel, e.g. of you don't care about studio, put the video bitrate info you want in there and then you can call it with $INFO[ListItem.Studio].

I'm away for a few days but I'll check ListItem.size at the weekend. I'm sure I've seen that info in other skins for my files though. I think Embuary has file details including size on the info screen.
Reply
#7
so TMM can create a mediainfo.xml that contains the info i am trying to import, is there a way to parse that file for the specific fields? lines 41 and 52 are the ones im after

here is the file contents:

xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--created on 2022-07-27 17:20:08 - tinyMediaManager 4.2.8-->
<MediaInfo xmlns="https://mediaarea.net/mediainfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
  <creatingLibrary url="https://www.tinymediamanager.org" version="4.2.8">tinyMediaManager</creatingLibrary>
  <media ref="/media/Movies/10 Cloverfield Lane (2016)-2160p/10 Cloverfield Lane (2016)_Atmos.HDR10.mkv">
    <track type="General">
      <Count>331</Count>
      <StreamCount>1</StreamCount>
      <StreamKind>General</StreamKind>
      <StreamKind_String>General</StreamKind_String>
      <StreamKindID>0</StreamKindID>
      <UniqueID>247415599284815074978182407305452437613</UniqueID>
      <UniqueID_String>247415599284815074978182407305452437613 (0xBA2282D9E1C3C50640FCA8D8DB35C06D)</UniqueID_String>
      <VideoCount>1</VideoCount>
      <AudioCount>2</AudioCount>
      <MenuCount>1</MenuCount>
      <Video_Format_List>HEVC</Video_Format_List>
      <Video_Format_WithHint_List>HEVC</Video_Format_WithHint_List>
      <Video_Codec_List>HEVC</Video_Codec_List>
      <Video_Language_List>English</Video_Language_List>
      <Audio_Format_List>MLP FBA 16-ch / AC-3</Audio_Format_List>
      <Audio_Format_WithHint_List>MLP FBA 16-ch / AC-3</Audio_Format_WithHint_List>
      <Audio_Codec_List>MLP FBA 16-ch / AC-3</Audio_Codec_List>
      <Audio_Language_List>English / English</Audio_Language_List>
      <CompleteName>/media/Movies/10 Cloverfield Lane (2016)-2160p/10 Cloverfield Lane (2016)_Atmos.HDR10.mkv</CompleteName>
      <FolderName>/media/Movies/10 Cloverfield Lane (2016)-2160p</FolderName>
      <FileNameExtension>10 Cloverfield Lane (2016)_Atmos.HDR10.mkv</FileNameExtension>
      <FileName>10 Cloverfield Lane (2016)_Atmos.HDR10</FileName>
      <FileExtension>mkv</FileExtension>
      <Format>Matroska</Format>
      <Format_String>Matroska</Format_String>
      <Format_Url>https://matroska.org/downloads/windows.html</Format_Url>
      <Format_Extensions>mkv mk3d mka mks</Format_Extensions>
      <Format_Commercial>Matroska</Format_Commercial>
      <Format_Version>Version 2</Format_Version>
      <FileSize>43198010320</FileSize>
      <FileSize_String>40.2 GiB</FileSize_String>
      <FileSize_String1>40 GiB</FileSize_String1>
      <FileSize_String2>40 GiB</FileSize_String2>
      <FileSize_String3>40.2 GiB</FileSize_String3>
      <FileSize_String4>40.23 GiB</FileSize_String4>
      <Duration>6214.791</Duration>
      <Duration_String>1 h 43 min</Duration_String>
      <Duration_String1>1 h 43 min 34 s 791 ms</Duration_String1>
      <Duration_String2>1 h 43 min</Duration_String2>
      <Duration_String3>01:43:34.791</Duration_String3>
      <Duration_String4>01:43:36;08</Duration_String4>
      <Duration_String5>01:43:34.791 (01:43:36;08)</Duration_String5>
      <OverallBitRate_Mode>VBR</OverallBitRate_Mode>
      <OverallBitRate_Mode_String>Variable</OverallBitRate_Mode_String>
      <OverallBitRate>55606710</OverallBitRate>
      <OverallBitRate_String>55.6 Mb/s</OverallBitRate_String>
      <FrameRate>23.976</FrameRate>
      <FrameRate_String>23.976 FPS</FrameRate_String>
      <FrameCount>149006</FrameCount>
      <StreamSize>10409410</StreamSize>
      <StreamSize_String>9.93 MiB (0%)</StreamSize_String>
      <StreamSize_String1>10 MiB</StreamSize_String1>
      <StreamSize_String2>9.9 MiB</StreamSize_String2>
      <StreamSize_String3>9.93 MiB</StreamSize_String3>
      <StreamSize_String4>9.927 MiB</StreamSize_String4>
      <StreamSize_String5>9.93 MiB (0%)</StreamSize_String5>
      <StreamSize_Proportion>0.00024</StreamSize_Proportion>
      <IsStreamable>Yes</IsStreamable>
      <Title>10 Cloverfield Lane</Title>
      <Movie>10 Cloverfield Lane</Movie>
      <Encoded_Date>UTC 2018-01-28 15:04:44</Encoded_Date>
      <File_Modified_Date>UTC 2018-01-28 15:25:24</File_Modified_Date>
      <File_Modified_Date_Local>2018-01-28 10:25:24</File_Modified_Date_Local>
      <Encoded_Application>MakeMKV v1.10.10 linux(x64-release)</Encoded_Application>
      <Encoded_Application_String>MakeMKV v1.10.10 linux(x64-release)</Encoded_Application_String>
      <Encoded_Library>libmakemkv v1.10.10 (1.3.5/1.4.7) x86_64-linux-gnu</Encoded_Library>
      <Encoded_Library_String>libmakemkv v1.10.10 (1.3.5/1.4.7) x86_64-linux-gnu</Encoded_Library_String>
    </track>
    <track type="Video">
      <Count>380</Count>
      <StreamCount>1</StreamCount>
      <StreamKind>Video</StreamKind>
      <StreamKind_String>Video</StreamKind_String>
      <StreamKindID>0</StreamKindID>
      <StreamOrder>0</StreamOrder>
      <ID>1</ID>
      <ID_String>1</ID_String>
      <OriginalSourceMedium_ID>4113</OriginalSourceMedium_ID>
      <OriginalSourceMedium_ID_String>4113 (0x1011)</OriginalSourceMedium_ID_String>
      <UniqueID>1</UniqueID>
      <Format>HEVC</Format>
      <Format_String>HEVC</Format_String>
      <Format_Info>High Efficiency Video Coding</Format_Info>
      <Format_Url>http://www.itu.int</Format_Url>
      <Format_Commercial>HEVC</Format_Commercial>
      <Format_Profile>Main [email protected]@high</Format_Profile>
      <HDR_Format>SMPTE ST 2086</HDR_Format>
      <HDR_Format_String>SMPTE ST 2086, HDR10 compatible</HDR_Format_String>
      <HDR_Format_Commercial>HDR10</HDR_Format_Commercial>
      <HDR_Format_Compatibility>HDR10</HDR_Format_Compatibility>
      <InternetMediaType>video/H265</InternetMediaType>
      <CodecID>V_MPEGH/ISO/HEVC</CodecID>
      <Duration>6214.792</Duration>
      <Duration_String>1 h 43 min</Duration_String>
      <Duration_String1>1 h 43 min 34 s 792 ms</Duration_String1>
      <Duration_String2>1 h 43 min</Duration_String2>
      <Duration_String3>01:43:34.792</Duration_String3>
      <Duration_String4>01:43:36;08</Duration_String4>
      <Duration_String5>01:43:34.792 (01:43:36;08)</Duration_String5>
      <BitRate>50338971</BitRate>
      <BitRate_String>50.3 Mb/s</BitRate_String>
      <Width>3840</Width>
      <Width_String>3 840 pixels</Width_String>
      <Height>2160</Height>
      <Height_String>2 160 pixels</Height_String>
      <Sampled_Width>3840</Sampled_Width>
      <Sampled_Height>2160</Sampled_Height>
      <PixelAspectRatio>1.000</PixelAspectRatio>
      <DisplayAspectRatio>1.778</DisplayAspectRatio>
      <DisplayAspectRatio_String>16:9</DisplayAspectRatio_String>
      <FrameRate_Mode>CFR</FrameRate_Mode>
      <FrameRate_Mode_String>Constant</FrameRate_Mode_String>
      <FrameRate>23.976</FrameRate>
      <FrameRate_String>23.976 (24000/1001) FPS</FrameRate_String>
      <FrameRate_Num>24000</FrameRate_Num>
      <FrameRate_Den>1001</FrameRate_Den>
      <FrameCount>149006</FrameCount>
      <ColorSpace>YUV</ColorSpace>
      <ChromaSubsampling>4:2:0</ChromaSubsampling>
      <ChromaSubsampling_String>4:2:0 (Type 2)</ChromaSubsampling_String>
      <ChromaSubsampling_Position>Type 2</ChromaSubsampling_Position>
      <BitDepth>10</BitDepth>
      <BitDepth_String>10 bits</BitDepth_String>
      <Bits-Pixel_Frame>0.253</Bits-Pixel_Frame>
      <Delay>0</Delay>
      <Delay_String3>00:00:00.000</Delay_String3>
      <Delay_Source>Container</Delay_Source>
      <Delay_Source_String>Container</Delay_Source_String>
      <StreamSize>39105773080</StreamSize>
      <StreamSize_String>36.4 GiB (91%)</StreamSize_String>
      <StreamSize_String1>36 GiB</StreamSize_String1>
      <StreamSize_String2>36 GiB</StreamSize_String2>
      <StreamSize_String3>36.4 GiB</StreamSize_String3>
      <StreamSize_String4>36.42 GiB</StreamSize_String4>
      <StreamSize_String5>36.4 GiB (91%)</StreamSize_String5>
      <StreamSize_Proportion>0.90527</StreamSize_Proportion>
      <Language>en</Language>
      <Language_String>English</Language_String>
      <Language_String1>English</Language_String1>
      <Language_String2>en</Language_String2>
      <Language_String3>eng</Language_String3>
      <Language_String4>en</Language_String4>
      <Default>No</Default>
      <Default_String>No</Default_String>
      <Forced>No</Forced>
      <Forced_String>No</Forced_String>
      <colour_description_present>Yes</colour_description_present>
      <colour_description_present_Source>Stream</colour_description_present_Source>
      <colour_range>Limited</colour_range>
      <colour_range_Source>Stream</colour_range_Source>
      <colour_primaries>BT.2020</colour_primaries>
      <colour_primaries_Source>Stream</colour_primaries_Source>
      <transfer_characteristics>PQ</transfer_characteristics>
      <transfer_characteristics_Source>Stream</transfer_characteristics_Source>
      <matrix_coefficients>BT.2020 non-constant</matrix_coefficients>
      <matrix_coefficients_Source>Stream</matrix_coefficients_Source>
      <MasteringDisplay_ColorPrimaries>Display P3</MasteringDisplay_ColorPrimaries>
      <MasteringDisplay_ColorPrimaries_Source>Stream</MasteringDisplay_ColorPrimaries_Source>
      <MasteringDisplay_Luminance>min: 0.0001 cd/m2, max: 1000 cd/m2</MasteringDisplay_Luminance>
      <MasteringDisplay_Luminance_Source>Stream</MasteringDisplay_Luminance_Source>
      <OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
    </track>
    <track type="Audio" typeorder="1">
      <Count>285</Count>
      <StreamCount>2</StreamCount>
      <StreamKind>Audio</StreamKind>
      <StreamKind_String>Audio</StreamKind_String>
      <StreamKindID>0</StreamKindID>
      <StreamKindPos>1</StreamKindPos>
      <StreamOrder>1</StreamOrder>
      <ID>2</ID>
      <ID_String>2</ID_String>
      <OriginalSourceMedium_ID>4352</OriginalSourceMedium_ID>
      <OriginalSourceMedium_ID_String>4352 (0x1100)</OriginalSourceMedium_ID_String>
      <UniqueID>2</UniqueID>
      <Format>MLP FBA</Format>
      <Format_String>MLP FBA 16-ch</Format_String>
      <Format_Info>Meridian Lossless Packing FBA with 16-channel presentation</Format_Info>
      <Format_Commercial>Dolby TrueHD with Dolby Atmos</Format_Commercial>
      <Format_Commercial_IfAny>Dolby TrueHD with Dolby Atmos</Format_Commercial_IfAny>
      <Format_AdditionalFeatures>16-ch</Format_AdditionalFeatures>
      <CodecID>A_TRUEHD</CodecID>
      <CodecID_Url>http://www.dolby.com/consumer/technology/trueHD.html</CodecID_Url>
      <Duration>6214.793</Duration>
      <Duration_String>1 h 43 min</Duration_String>
      <Duration_String1>1 h 43 min 34 s 793 ms</Duration_String1>
      <Duration_String2>1 h 43 min</Duration_String2>
      <Duration_String3>01:43:34.793</Duration_String3>
      <Duration_String5>01:43:34.793</Duration_String5>
      <BitRate_Mode>VBR</BitRate_Mode>
      <BitRate_Mode_String>Variable</BitRate_Mode_String>
      <BitRate>4614336</BitRate>
      <BitRate_String>4 614 kb/s</BitRate_String>
      <BitRate_Maximum>8544000</BitRate_Maximum>
      <BitRate_Maximum_String>8 544 kb/s</BitRate_Maximum_String>
      <Channels>8</Channels>
      <Channels_String>8 channels</Channels_String>
      <ChannelPositions>Front: L C R, Side: L R, Back: L R, LFE</ChannelPositions>
      <ChannelPositions_String2>3/2/2.1</ChannelPositions_String2>
      <ChannelLayout>L R C LFE Ls Rs Lb Rb</ChannelLayout>
      <SamplesPerFrame>40</SamplesPerFrame>
      <SamplingRate>48000</SamplingRate>
      <SamplingRate_String>48.0 kHz</SamplingRate_String>
      <SamplingCount>298310040</SamplingCount>
      <FrameRate>1200.000</FrameRate>
      <FrameRate_String>1 200.000 FPS (40 SPF)</FrameRate_String>
      <FrameCount>7457751</FrameCount>
      <BitDepth>24</BitDepth>
      <BitDepth_String>24 bits</BitDepth_String>
      <Compression_Mode>Lossless</Compression_Mode>
      <Compression_Mode_String>Lossless</Compression_Mode_String>
      <Delay>0</Delay>
      <Delay_String3>00:00:00.000</Delay_String3>
      <Delay_Source>Container</Delay_Source>
      <Delay_Source_String>Container</Delay_Source_String>
      <Video_Delay>0</Video_Delay>
      <Video_Delay_String3>00:00:00.000</Video_Delay_String3>
      <StreamSize>3584642550</StreamSize>
      <StreamSize_String>3.34 GiB (8%)</StreamSize_String>
      <StreamSize_String1>3 GiB</StreamSize_String1>
      <StreamSize_String2>3.3 GiB</StreamSize_String2>
      <StreamSize_String3>3.34 GiB</StreamSize_String3>
      <StreamSize_String4>3.338 GiB</StreamSize_String4>
      <StreamSize_String5>3.34 GiB (8%)</StreamSize_String5>
      <StreamSize_Proportion>0.08298</StreamSize_Proportion>
      <Title>Surround 7.1</Title>
      <Language>en</Language>
      <Language_String>English</Language_String>
      <Language_String1>English</Language_String1>
      <Language_String2>en</Language_String2>
      <Language_String3>eng</Language_String3>
      <Language_String4>en</Language_String4>
      <Default>Yes</Default>
      <Default_String>Yes</Default_String>
      <Forced>No</Forced>
      <Forced_String>No</Forced_String>
      <OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
      <NumberOfDynamicObjects>11</NumberOfDynamicObjects>
      <BedChannelCount>1</BedChannelCount>
      <BedChannelCount_String>1 channel</BedChannelCount_String>
      <BedChannelConfiguration>LFE</BedChannelConfiguration>
    </track>
    <track type="Audio" typeorder="2">
      <Count>311</Count>
      <StreamCount>2</StreamCount>
      <StreamKind>Audio</StreamKind>
      <StreamKind_String>Audio</StreamKind_String>
      <StreamKindID>1</StreamKindID>
      <StreamKindPos>2</StreamKindPos>
      <StreamOrder>2</StreamOrder>
      <ID>3</ID>
      <ID_String>3</ID_String>
      <OriginalSourceMedium_ID>4352</OriginalSourceMedium_ID>
      <OriginalSourceMedium_ID_String>4352 (0x1100)</OriginalSourceMedium_ID_String>
      <UniqueID>3</UniqueID>
      <Format>AC-3</Format>
      <Format_String>AC-3</Format_String>
      <Format_Info>Audio Coding 3</Format_Info>
      <Format_Url>https://en.wikipedia.org/wiki/AC3</Format_Url>
      <Format_Commercial>Dolby Digital</Format_Commercial>
      <Format_Commercial_IfAny>Dolby Digital</Format_Commercial_IfAny>
      <Format_Settings>Dolby Surround EX</Format_Settings>
      <Format_Settings_Mode>Dolby Surround EX</Format_Settings_Mode>
      <Format_Settings_Endianness>Big</Format_Settings_Endianness>
      <CodecID>A_AC3</CodecID>
      <Duration>6214.816</Duration>
      <Duration_String>1 h 43 min</Duration_String>
      <Duration_String1>1 h 43 min 34 s 816 ms</Duration_String1>
      <Duration_String2>1 h 43 min</Duration_String2>
      <Duration_String3>01:43:34.816</Duration_String3>
      <Duration_String4>01:44:24:29</Duration_String4>
      <Duration_String5>01:43:34.816 (01:44:24:29)</Duration_String5>
      <BitRate_Mode>CBR</BitRate_Mode>
      <BitRate_Mode_String>Constant</BitRate_Mode_String>
      <BitRate>640000</BitRate>
      <BitRate_String>640 kb/s</BitRate_String>
      <Channels>6</Channels>
      <Channels_String>6 channels</Channels_String>
      <ChannelPositions>Front: L C R, Side: L R, LFE</ChannelPositions>
      <ChannelPositions_String2>3/2/0.1</ChannelPositions_String2>
      <ChannelLayout>L R C LFE Ls Rs</ChannelLayout>
      <SamplesPerFrame>1536</SamplesPerFrame>
      <SamplingRate>48000</SamplingRate>
      <SamplingRate_String>48.0 kHz</SamplingRate_String>
      <SamplingCount>298311168</SamplingCount>
      <FrameRate>31.250</FrameRate>
      <FrameRate_String>31.250 FPS (1536 SPF)</FrameRate_String>
      <FrameCount>194213</FrameCount>
      <Compression_Mode>Lossy</Compression_Mode>
      <Compression_Mode_String>Lossy</Compression_Mode_String>
      <Delay>0</Delay>
      <Delay_String3>00:00:00.000</Delay_String3>
      <Delay_Source>Container</Delay_Source>
      <Delay_Source_String>Container</Delay_Source_String>
      <Video_Delay>0</Video_Delay>
      <Video_Delay_String3>00:00:00.000</Video_Delay_String3>
      <StreamSize>497185280</StreamSize>
      <StreamSize_String>474 MiB (1%)</StreamSize_String>
      <StreamSize_String1>474 MiB</StreamSize_String1>
      <StreamSize_String2>474 MiB</StreamSize_String2>
      <StreamSize_String3>474 MiB</StreamSize_String3>
      <StreamSize_String4>474.2 MiB</StreamSize_String4>
      <StreamSize_String5>474 MiB (1%)</StreamSize_String5>
      <StreamSize_Proportion>0.01151</StreamSize_Proportion>
      <Title>Surround 5.1</Title>
      <Language>en</Language>
      <Language_String>English</Language_String>
      <Language_String1>English</Language_String1>
      <Language_String2>en</Language_String2>
      <Language_String3>eng</Language_String3>
      <Language_String4>en</Language_String4>
      <ServiceKind>CM</ServiceKind>
      <ServiceKind_String>Complete Main</ServiceKind_String>
      <Default>No</Default>
      <Default_String>No</Default_String>
      <Forced>No</Forced>
      <Forced_String>No</Forced_String>
      <OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
      <bsid>6</bsid>
      <dialnorm>-27</dialnorm>
      <dialnorm_String>-27 dB</dialnorm_String>
      <compr>1.94</compr>
      <compr_String>1.94 dB</compr_String>
      <dynrng>1.26</dynrng>
      <dynrng_String>1.26 dB</dynrng_String>
      <acmod>7</acmod>
      <lfeon>1</lfeon>
      <dialnorm_Average>-27</dialnorm_Average>
      <dialnorm_Average_String>-27 dB</dialnorm_Average_String>
      <dialnorm_Minimum>-27</dialnorm_Minimum>
      <dialnorm_Minimum_String>-27 dB</dialnorm_Minimum_String>
      <dialnorm_Maximum>-27</dialnorm_Maximum>
      <dialnorm_Maximum_String>-27 dB</dialnorm_Maximum_String>
      <dialnorm_Count>38</dialnorm_Count>
      <compr_Average>2.54</compr_Average>
      <compr_Average_String>2.54 dB</compr_Average_String>
      <compr_Minimum>1.94</compr_Minimum>
      <compr_Minimum_String>1.94 dB</compr_Minimum_String>
      <compr_Maximum>3.15</compr_Maximum>
      <compr_Maximum_String>3.15 dB</compr_Maximum_String>
      <compr_Count>38</compr_Count>
      <dynrng_Average>1.88</dynrng_Average>
      <dynrng_Average_String>1.88 dB</dynrng_Average_String>
      <dynrng_Minimum>1.26</dynrng_Minimum>
      <dynrng_Minimum_String>1.26 dB</dynrng_Minimum_String>
      <dynrng_Maximum>2.57</dynrng_Maximum>
      <dynrng_Maximum_String>2.57 dB</dynrng_Maximum_String>
      <dynrng_Count>38</dynrng_Count>
    </track>
    <track type="Menu">
      <Count>110</Count>
      <StreamCount>1</StreamCount>
      <StreamKind>Menu</StreamKind>
      <StreamKind_String>Menu</StreamKind_String>
      <StreamKindID>0</StreamKindID>
      <Chapters_Pos_Begin>94</Chapters_Pos_Begin>
      <Chapters_Pos_End>110</Chapters_Pos_End>
      <_00_00_00_000>en:Chapter 01</_00_00_00_000>
      <_00_05_55_605>en:Chapter 02</_00_05_55_605>
      <_00_14_52_391>en:Chapter 03</_00_14_52_391>
      <_00_19_18_157>en:Chapter 04</_00_19_18_157>
      <_00_24_11_867>en:Chapter 05</_00_24_11_867>
      <_00_32_21_648>en:Chapter 06</_00_32_21_648>
      <_00_42_59_159>en:Chapter 07</_00_42_59_159>
      <_00_47_47_406>en:Chapter 08</_00_47_47_406>
      <_00_53_36_963>en:Chapter 09</_00_53_36_963>
      <_00_57_00_375>en:Chapter 10</_00_57_00_375>
      <_01_03_10_745>en:Chapter 11</_01_03_10_745>
      <_01_11_20_192>en:Chapter 12</_01_11_20_192>
      <_01_15_49_419>en:Chapter 13</_01_15_49_419>
      <_01_24_21_097>en:Chapter 14</_01_24_21_097>
      <_01_28_18_960>en:Chapter 15</_01_28_18_960>
      <_01_37_31_512>en:Chapter 16</_01_37_31_512>
    </track>
  </media>
</MediaInfo>
Reply
#8
Not sure, never used TMM, I was thinking to put the info in a field that Kodi has an infolabel for that you don't care about. I don't think you can create new fields in the database unless you use a script or something
Reply
#9
Actually you could probably parse it from the filename as you originally wanted to with a script..

Embuary Helper has a split string function:

https://github.com/sualfred/script.embua...plit-value
Quote:Split value
Splits a provided value by the set separator to window properties.

Arguments

value= (required)
prop= (required)
separator= (optional, default splitting is done by lines)
Example

RunScript(script.embuary.helper,action=split,value='$ESCINFO[ListItem.Genre]',separator='" / "',prop=MySplit)

Result example

Window(home).Property(MySplit.0)
Window(home).Property(MySplit.1)
Window(home).Property(MySplit.2)
Reply
#10
Create a helper script inside the skin folder and call it on onload/onunload with ListItem.FileNameAndPath as a parameter. The script istself set a property with the formatted file size which can be read from the skin. Estuary ModV2 do this in this manner:

https://github.com/b-jesch/skin.estuary....fo.xml#L10
https://github.com/b-jesch/skin.estuary....fo.xml#L14
https://github.com/b-jesch/skin.estuary....#L707-L713

The helper script: https://github.com/b-jesch/skin.estuary....helpers.py
Reply
#11
(2023-04-01, 18:06)_BJ1 Wrote: Create a helper script inside the skin folder and call it on onload/onunload with ListItem.FileNameAndPath as a parameter. The script istself set a property with the formatted file size which can be read from the skin. Estuary ModV2 do this in this manner:

https://github.com/b-jesch/skin.estuary....fo.xml#L10
https://github.com/b-jesch/skin.estuary....fo.xml#L14
https://github.com/b-jesch/skin.estuary....#L707-L713

The helper script: https://github.com/b-jesch/skin.estuary....helpers.py

Are skin level scripts a good idea?

I recently started playing around with them as simple helper functions for my skin but I'm getting these messages in the log:-

Code:
2023-04-05 19:22:11.172 T:24460 warning <general>: CPythonInvoker(24): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
2023-04-05 19:22:11.331 T:24462 warning <general>: CPythonInvoker(25): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
2023-04-05 19:22:11.494 T:24465 warning <general>: CPythonInvoker(26): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.

Does this message mean the ability to use skin level scripts will be completely removed or just the Adding all addon modules installed to python path as fallback behaviour will be removed. The message seems to be unclear.
Reply
#12
You can put every skin level script into an addon and make that to a dependency of course. Same effect.
(2023-04-05, 20:28)roidy Wrote: The message seems to be unclear.

Indeed. But as skin level scripts use also imports like normal addons there's no need to import the whole bunch of modules. Additional they can declared and act as normal scripts.
Reply
#13
Thanks for the reply.

Quote:You can put every skin level script into an addon and make that to a dependency of course. Same effect.

Sure, but that defeats the point of skin level scripts. If it's a simple helper function then you don't really want the hassle of creating a full add-on that you have to ship seperate to your skin.

Quote:But as skin level scripts use also imports like normal addons there's no need to import the whole bunch of modules.

That's the problem in my skin level script I'm just importing import xbmc as that's all I need. So why is Kodi telling me it's importing everything as a fallback?

Quote:Additional they can declared and act as normal scripts.

Sorry, no idea what you mean by that?
Reply
#14
(2023-04-05, 20:46)_BJ1 Wrote: Additional they can declared and act as normal scripts.
They could included as normal python scripts into the addon mechanism of kodi. That mean they could updated separatly from skin in future if there are any changes/updates.
(2023-04-05, 21:51)roidy Wrote: I'm just importing import xbmc as that's all I need. So why is Kodi telling me it's importing everything as a fallback?

Possibly this will be removed in the future. Who knows.
Reply
#15
(2023-04-06, 09:14)_BJ1 Wrote: Possibly this will be removed in the future. Who knows.

That's what is unclear about the message.... What will be removed in the future:-

Script invoked without an addon. - Meaning you wont ever be able to use skin level scripts, so there's no point starting to develop them.
Adding all addon modules installed to python path as fallback. - The adding of all modules as a fallback, meaning we can still carry on using skin level scripts.

This behaviour will be removed in future version. - Vague message.... Which behaviour is it referring to  Huh
Reply

Logout Mark Read Team Forum Stats Members Help
InfoLabel parsing help0