Is there an API call I can make that'll refresh a stale network share?
#1
I'm not even sure how to google this because my implementation is fairly strange: I use kodi, but I don't use any of the library functionality at all. I access everything only as files in a network share, and I rarely use the kodi interface itself, I have my own custom made UI that I use my phone for. 

So here's my problem. When I go and add a file to my network share, let's say I add a new movie, then I try to tell kodi to play it by using the JSON call to add it to the playlist: it says the file doesn't exist. I'm guessing it just wasn't there the last time it indexed the network share and there's nothing to tell it to refresh.

If I go into the kodi interface to my movies folder, that indeed does tell the network share to refresh and kodi can find it and all is right with the world. But I'd love to throw an API call into my custom UI that does it for me. Basically instead of "see if this file exists, then play", I want it to "refresh the network share, then see if the file exists and start playing".

A lot of the JSON documentation calls about library functionality, which again, I don't use. I pretty much only use it as a samba network share and then tell kodi to look in the local /media/movies folder (which has been mounted to my samaba share in fstab). 

I'm pretty sure I could throw a cronjob in to basically "ls /media/movies" every hour or whatever, but I'd rather only do it at the time it's actually needed, which is right before attempting to add the file to the playlist. 

Thoughts?
Reply
#2
I have an alias for kodi-send -a "UpdateLibrary(video)" that I use to have Kodi re-read new content in its media paths.

(Similarly, kodi-send -a "CleanLibrary(video)" to flush out redundant entries after I've cleared older series off the NAS)
Reply



Logout Mark Read Team Forum Stats Members Help
Is there an API call I can make that'll refresh a stale network share?0
This forum uses Lukasz Tkacz MyBB addons.