smitchell6879 / plugin.video.specialfeatures

Inspired by the new bluray features of Kodi 18; This addon will present all of the bonus videos, discs, versions you have of movies in your library.
GNU General Public License v3.0
2 stars 0 forks source link

Provide better discoverability for items containing special features. #27

Open evertiro opened 6 years ago

evertiro commented 6 years ago

Cross posted from https://forum.kodi.tv/showthread.php?tid=327042&pid=2714296#pid2714296

The following has been suggested as a quick fix:

<visible>System.HasAddon(plugin.video.specialfeatures) + !String.IsEmpty(Window(home).Property(SpecialFeatures.Visible))</visible>

Per wyrm:

I say its slow as your window property is a string and not a boolean, thus you have to use string operations to check it (much, much slower than boolean operations under Kodi).

I can't offer any python pointers on listitem properties as my python is rudimentary at best, but you might like to check out Marcel's skin helper scripts as he makes extensive use of listitem properties to add to the music and video library. As the script stands I guess the user can now see if the current item has any special features, but it would be better if we could display something for the non focused items as well. If nothing else changing Window(home).Property(SpecialFeatures.Visible) to a boolean will speed up the checks required by the skin.

evertiro commented 6 years ago

RE: https://forum.kodi.tv/showthread.php?tid=327042&pid=2714355#pid2714355

Sorry guys, Yes you are correct it is window properties and so only possible for the focused item. Have been reviewing my skin code for Voldermorts extras script implementation and now realise what he did to allow flags for focused AND unfocused listitems. He copied a image file named for the listitems DBID into his scripts addon_data directory for each listitem with extras found during his extras directory scan. Then the skin writer would use something like this to display the file:

$INFO[ListItem.DBID,special://profile/addon_data/script.videoextras/movies/,.png]

Rather cunning really. At the risk of being labelled a Deatheater, could not the same trick be pulled but stored in the Kodi video library as a new Art type (SpecialFeatureFlag). That way we could take advantage of the library image cache and avoid some of the file i/o that the above entails. Pretty sure addons are allowed to add new Art types to the db, otherwise just use the original trick and we can then show a flag for both focused and unfocused listitems.