Library.HasContent(Pictures) implementation
#1
Hi all,

In my skin I would need a Library.HasContent(Pictures), looking at the code it doesn't seem to be supported, so I am thinking about implementing this myself.

For me this should be true if at least one picture file has been detected in any of the declared picture sources from sources.xml. My idea was to a basic recursive search of all the declared path until a picture file is found.

Obviously for large volumes this can take some time, so I am thinking the result could be cached in a db, but then it would not detect additions/deletion of files in the concerned path.

Any suggestion about this?

PS: Is there a recommended way to search within list of path with kodi? Should I use the same implementation as the musicInfoScanner for instance?
Reply
#2
it was recently added: https://github.com/xbmc/xbmc/pull/8679
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Hi Ronie,

I am not sure how this commit provides the same functionality as something like Library.HasContent(Pictures). Which condition should be used to test the picture library status?
Reply
#4
There is no picture library only a way to check the content is pictures.

Code:
Container.Content(images)
Reply
#5
Right, technically speaking there is no picture library.

If I understand correctly Container.Content(images) is testing if the container is supposed to contain pictures, but there is no way to check if it actually contains at least one picture file?

The idea would be to display some specific controls when the Pics View is empty, inviting the user to add sources.

Do you think that scanning all the sources to search for a picture file is overkill?
Reply

Logout Mark Read Team Forum Stats Members Help
Library.HasContent(Pictures) implementation1