Beta -  Library Search
Introducing the Library Search script - a WIP script to provide a search facility for music and videos in your library.

Unlike other solutions which query Kodi directly and provide the results in their own windows, this script doesn't provide any results itself - instead it provides a set of template library nodes which it customises with your search term. This means search results are shown in the skins normal library views; the search types are easy to customise without knowing any Python; there's the possibility to integrate with other addons to provide results (for example, a PVR search addon could be directly integrated); with some plugins you can integrate them so you can link directly to their search results.


I often work on little 'proof of concept' scripts, where I'm playing around to see if something is possible within Kodi. Most of the time it's not. Very occasionally it does work, but isn't interesting enough to share. Once in a blue moon there's something like this where the basic idea works and is interesting - at which point I'm happy to share the idea with the hope the community can help me bring it through to an actually workable solution.


The script is available on my personal repo, the latest version which can be installed via Kodi's 'Install from zip' is here, or for those who are happy manually installing scripts the source is here.

Known Issues
  • Krypton only
  • No PVR search
  • Navigation still needs some work, particularly going 'back' from integrated plugins.
  • Search results are limited by the power of library nodes. In practical terms that means we're looking at search results where the items 'contain' the search string
  • Because it, to some degree, abuses the Library Nodes feature of Kodi it's quite possible this won't be considered acceptable for the official Kodi repo
  • All those thousands of minor issues hopefully you can help in finding Smile

Plugin Integration

It's possible to link directly to some plugins own search results. Only plugins that support passing a search term in their path will work - place ::SEARCHTERM:: in the relevant part of the URI. Note that you should ask plugin authors directly if their plugin works in this way and what the path should be. Please also remember the forum rules (wiki) as they relate to banned add-ons (wiki).

Plugin integration is accessed through this plugins settings.

Any and all feedback is very welcome.
Had to give it a try, even though I've already skinned the global search addon. Wink

After testing for just a minute, I have to say this is pretty cool and look promising. My only wishlist at this point is to hide nodes that don't contain any results and provide an option to not search movie plots. At first I thought it wasn't working right when it returned so many results, lol.

Great work Bob, looking forward to see how this develops. Happy New Years!
Thanks for testing, Braz Smile

Your feedback highlights both the strengths and the weaknesses of doing a search in this manner. On the strengths side, separating a title search and a plot search is incredibly easy - and now available on git/my repo. On the weakness side, because the results are actually powered by library nodes there's no way to hide nodes that have no results as far as I'm aware (and, indeed, by the time Kodi gets to displaying that level, the scripts work is already done and Kodi is displaying the various 'template' nodes that have been customised with the search term, so any such feature would actually be a Kodi-level feature and not a script one).

And a very happy new year to you.
Just thinking out loud here...

I noticed when searching for "whiskey", for example, that it appears to try to match year, genre, etc to the search term. What if, instead, the plugin just matches movie titles to the search term, and then displays those items in the year/genres nodes? Does that make sense, or is it even possible?

So if you have 3 movies that contain the search term in the title (or plot), those 3 items would be displayed in the Year node under their respective years. Same goes for the Genres, Studios, and Countries nodes.
Interesting idea Smile It definitely makes sense and is absolutely possible.

I think some care would be needed to differentiate between viewing movies whose title match by director, and a search for directors for example. I also want to be careful about not putting in too many levels between starting a search and actually seeing the results. Possibly either separate different search types in the first instance (so rather than selecting 'Movies', you could select 'Movie Title', 'Movie Plot', 'Movie Director' and so on and then provide the different groupings; or after selecting 'Movies' have a node there for 'Movie Title' and a parent node for 'Movie Title (views)'. Anyone have any preference/other ideas?

I'll think on and have put something together when I've got a concrete idea of how to proceed.
Very cool idea!
[Image: addon-TheMealDB-blue.svg] [Image: skin-EstuaryATF-green.svg]
Updated version with - hopefully - much clearer Video search results (with the ability to explore each result category by genre, year and so on) now available.

(2017-01-04, 18:28)docwra Wrote: Very cool idea!

Thanks Smile Let me know if you have any suggestions.
Very very interesting addon, i love the "integrated" feel compared to other search addons..

I'm also just thinking out loud..
I'm feeling sometimes the way back is very useful, but sometimes I just want to leave the results and go back home screening or start a new search...

do you think you can append a couple listitem to the final result?

kind of
(maybe leaving an empty labelled one btw the actual items and the extra)

Image [Image: bannersio2.png]
Did I Help? Add to my reputation
Thanks for the feedback Smile

In general terms, the navigation of the whole add-on still need work so feedback on this is particularly welcome. Especially when it comes to the - added in the last few hours - plugin integration, where going 'back' doesn't necessarily take you back to the level you expect (at present, going back will initially take you to the root level of the plugin - no matter what level the plugin was entered at - I'm still looking at what, if anything, I can do about this) before another 'back' takes you back to the Library Search addon.

For the specific situations you talk about - at the level of 'Videos', 'Music Videos', 'Music', [Plugin] - I'm not sure of the need to add any extra navigation at this level as all normal navigation should act as expected, though do tell me if I'm wrong Smile. Once you get beyond that level (at which point you're looking at library/plugin nodes, and not the script itself) I can add a 'New search' item with relative ease, though not for plugin's and not once you get beyond this level. Going back to the home screen feels like something better accomplished with keymaps, if you don't already have a button assigned to 'Home'...
Thanks to everyone whose tried this addon, and extra thanks to those who've given feedback. I'm a great believer in not pushing my own work, so I've pushed one final update to the script which makes it all-but-feature complete on what I originally envisioned. Whilst I'll continue to keep a version for myself up-to-date, v0.0.8 represents the last version I'll publish in the classic see-if-anyone-is-interested-in-this. For the record, this version adds a variety of extra search options - all of which display a default list of results by default, with extra ways to explore the results (such as by genre, year and so on) available on the context menu.

For anyone interested in the script, it will continue to be updated for my own use on git but I have no further planned public releases at this time Smile
Thanks Bob, I'm going to try 0.8 and I plan to keep up with any updates you push to GitHub. Smile

Appreciate your work on this!
Cheers Braz Smile

As I say, I'm going to continue the development of the script for my own purposes at the very least - so if you do have any ideas or feedback on any aspect of the script, please do open an issue on git Smile
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Library Search00