Kodi Community Forum

Full Version: GlobalSearch for Kodi Leia
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
for kodi leia i've decided to rewrite the globalsearch addon from scratch.
this means skinners will also have to rewrite their custom xml for the globalsearch addon from scratch....

luckily this isn't as bad as it sounds and should be relatively (hopefully) easy.

some notable changes:
  • the main window (script-globalsearch.xml) is now a window instead of a dialog (as much requested by skinners)
  • i've removed as much required id's as possible. only a few mandatory id's remain
  • the globalsearch window behaves (almost) like a regular videolibrary/musiclibrary window:
    • the addon will use DialogMusicInfo.xml / DialogVideoInfo.xml from your skin, no need to create a globalsearch infodialog anymore
    • you can define multiple viewtypes if you like
    • using Container.Content() should work
    • ListItem.Art() should work
    • you can now use normal infolabels like you're used to: for instance ListItem.Genre instead of ListItem.Property(genre)
... it might even be as simple as just including the views you've already created for the video/music library in the globalsearch xml file.
I've been using it and skinned it for Omni, great work Ronie!
Cannot give you a full feedback, because I'm still on v17 but as you know I used it a while ago for Krypton where the video DB things worked perfectly. Only playing/enter music stuff was broken (because of Krypton, works on Leia).
As soon as I'm on the Leia train, I'll change my implementation to support your new v8. Thanks!
Nice!
Hi Ronie,

Thanks for your job !

One question, how to assign icons and fanarts for items for list ID 9000 ? There is no content in your template.

EDIT : Just find in source code, file must be named 'globalsearch-icon-movies.png' etc.. in 'media' folder.

It would be good if we can choose path of icons, in v7 I used : 

Code:
<item id="1">
                                <label>$LOCALIZE[342]</label>
                                <label2>$LOCALIZE[283]$INFO[Control.GetLabel(110),: ]</label2>
                                <thumb>icons/sidemenu/movies.png</thumb>
                                <visible>Control.IsVisible(119)</visible>
                            </item>
                            <item id="2">
                                <label>$LOCALIZE[20343]</label>
                                <label2>$LOCALIZE[283]$INFO[Control.GetLabel(120),: ]</label2>
                                <thumb>icons/sidemenu/tv.png</thumb>
                                <visible>Control.IsVisible(129)</visible>
                            </item>
good question... i didn't think of that.
the menu is constructed by the addon now and it sets the icons as well.

you should be able to override them though, by using the same filenames as the addon does.
place your icons, using these filenames, in your media folder:
  • globalsearch-icon-actors.png
  • globalsearch-icon-albums.png
  • globalsearch-icon-artists.png
  • globalsearch-icon-directors.png
  • globalsearch-icon-episodes.png
  • globalsearch-icon-livetv.png
  • globalsearch-icon-movies.png
  • globalsearch-icon-musicvideos.png
  • globalsearch-icon-seasons.png
  • globalsearch-icon-songs.png
  • globalsearch-icon-tvshows.png


i'm thinking... perhaps i should move them to a subfolder, like media/globalsearch/*.png
so skins can keep things neatly organized ?
I override the icons and that worked well...no strong feelings about putting them in a subfolder.

I'm wondering though, why not just use the default Kodi icons that match these content types?
(2018-01-12, 00:15)braz Wrote: [ -> ]I override the icons and that worked well...no strong feelings about putting them in a subfolder.

I'm wondering though, why not just use the default Kodi icons that match these content types?
 I prefer use media/globalsearch-icon-*.png

Sizes of my default kodi icons are too big to use in a small list and even keeping the aspectratio, the quality of resizing is not terrible.
I did several tests, everything seems to work properly

Image

Image

Image
Great work ronie.

I really appreciate this. Can't wait to take it for a spin. Wink
Hi Ronie,

Great work as always. Now at the risk of you misunderstanding the request could you please add a search addons section to your script?

Just to be clear by search addons I do NOT mean search thru addons (which I know is not possible), but search for a particular addon. I have on occasion needed to find a particular addon but am not sure which section it lives in (is it a program addon or a video addon?), or more likely I have just plain forgot exactly what it was called.

It would be really useful to not have to navigate down thru the addons section to find the search option but to be able to use a global (read, use anywhere) search.

Wyrm
there's currently no way in python to set addon specific infolabels, like ListItem.AddonVersion / ListItem.AddonDescription / ListItem.AddonCreator

so i would either have to add this functionality to kodi first (no idea how difficult that would be)...
or use a workaround in globalsearch to set them as listitem properties instead: ListItem.Property(AddonVersion) / ListItem.Property(AddonDescription) / ListItem.Property(AddonCreator)

since i don't like workarounds, i'll check how easy the first option is going to be
Ronie thanks for at least considering the request. Will watch to see how this pans out.

Wyrm
well, after struggling with it for hours, i now know i'm unqualified to make the needed changes in kodi ;-)
Have you thought of a way to still be able to use search specifically?

I have a whole sub-menu under search with Actors, Director, Episodes, etc. launched via:
RunScript(script.globalsearch,movies=true)
and
RunScript(script.globalsearch,directors=true)
etc.

And with the new XML changes, their results are now empty, not "No search Result found" empty, but a partially working page displaying nothing.

The rest of the changes are great. I have the general search results looking just like the rest of Metropolis now.
Image
Pages: 1 2 3 4 5 6