Solved Updating kodi library without opening the gui
#1
I haven't followed kodi development in a while... so i was wondering is it already possible to update library without running kodi? I have a windows server running kodi and it also acts as iscsi boot server for multiple clients (which is a great way to share kodi library content btw)
Whenever i open kodi and a client boots, it would lock up the library.. therefore i need a way to update Kodi library without opening it, and then close the update process once its done.. is it already possible to do this?
Reply
#2
Not atm: but is in the road map for the future (asynchronous threaded background loading of metadata) http://trac.kodi.tv/roadmap?show=all
Reply
#3
I'm curious as to why you wouldn't just run mysql on the windows server, then you could share a library without running multiple instances of kodi being an issue...
What's the advantage of what you're doing?
Reply
#4
(2016-08-23, 19:10)PatK Wrote: Not atm: but is in the road map for the future (asynchronous threaded background loading of metadata) http://trac.kodi.tv/roadmap?show=all

Hmm i see.. Have to wait for new version then.. but my custom skin doesnt like newer version...
Is there anyway to use scripting & JSON to achieve this purpose?
e.g :

1. Launch Kodi remotely
2. Remote update Kodi with Curl :
Code:
"C:\Program Files\cURL\bin\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:pass@ipaddress:port/jsonrpc > NUL 2>&1
3. Close Kodi once update is done

After reading some thread looks like #1 is impossible with JSON.. while #2 requires Kodi to be active..
And about #3 does Kodi release some kind of trigger once it's done updating?

Edit :
I suppose i could use psexec to start and close Kodi remotely with batch script.. but i havent tried this

Code:
psexec -u administrator -p force \\serverip -s -d cmd.exe /c "C:\startkodi.bat"

So now the question is.. is there anyway to retrieve the flag of "finished update" ?

(2016-08-23, 19:19)trogggy Wrote: I'm curious as to why you wouldn't just run mysql on the windows server, then you could share a library without running multiple instances of kodi being an issue...
What's the advantage of what you're doing?

ISCSI boot is a block level boot, so once it's booted it feels like running Kodi from local storage.. I haven't compared the performance to MySQL but so far i'm running for 20+ clients and there's no major complaints... The drawback of course computer booted with ISCSI method have centralized content, and that's probably not for everybody...
Reply
#5
Of course anything is possible, it's just the effort, time and determination, it's all open source.

Here's a few links, that you might want t o look over. Syncing and sharing (wiki) HOW-TO:Share libraries using UPnP (wiki)

http://lifehacker.com/5634515/how-to-syn...-the-house
http://www.howtogeek.com/75535/how-to-sy...with-xbmc/
http://forum.kodi.tv/showthread.php?pid=1900228
Reply
#6
(2016-08-24, 05:04)PatK Wrote: Of course anything is possible, it's just the effort, time and determination, it's all open source.

Here's a few links, that you might want t o look over. Syncing and sharing (wiki) HOW-TO:Share libraries using UPnP (wiki)

http://lifehacker.com/5634515/how-to-syn...-the-house
http://www.howtogeek.com/75535/how-to-sy...with-xbmc/
http://forum.kodi.tv/showthread.php?pid=1900228

Hmm you're missing the point.. i'm not asking about sharing Kodi content.. But your first sentence is right Smile
It's possible to achieve what i want with callback addons + psexec script + open & close Kodi batch scripts ..

Currently i'm stuck with this, i cant seem to start Kodi remotely using PSEXEC

Code:
C:\PSTools\psexec -u Administrator -p 123456 \\192.168.0.148 -s -d cmd.exe /c "C:\startkodi.bat"

The script itself works fine, but it only starts Kodi process.. not GUI.. any idea why?
Reply
#7
I tried for a while but never succeeded launching Kodi without actually being logged into the windows PC - I was using a batch file to run Kodi, triggered with Task Scheduler.
In my case, it would launch the Kodi process and the initial window, but would not populate the UI with the menu elements until I logged into the windows PC physically/RDP/Chrome Remote Desktop (don't know if I have descried this well). Without the UI elements loaded, Kodi would not accept JSON connections (for me anyway).

So, now I just leave Kodi running 24/7 on the windows PC and run a JSON command as part of my automation script to update the library (mysql)
Code:
start curl -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:[email protected]:8080/jsonrpc > NUL 2>&1
4x R-Pi4b LibreELEC v10 | Aeon Nox: SiLVO | Flirc cases
Storage Synology DS411 | 4 x WD RED 6TB
Software MariaDB 10.4.19 | Filebot | Ember Media Manager
wiki (wiki) | First time user (wiki) | Debug_Log (wiki) | mysql (wiki) | artwork (wiki)
Reply
#8
(2016-08-24, 15:19)zerocool_ie Wrote: I tried for a while but never succeeded launching Kodi without actually being logged into the windows PC - I was using a batch file to run Kodi, triggered with Task Scheduler.
In my case, it would launch the Kodi process and the initial window, but would not populate the UI with the menu elements until I logged into the windows PC physically/RDP/Chrome Remote Desktop (don't know if I have descried this well). Without the UI elements loaded, Kodi would not accept JSON connections (for me anyway).

So, now I just leave Kodi running 24/7 on the windows PC and run a JSON command as part of my automation script to update the library (mysql)
Code:
start curl -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:[email protected]:8080/jsonrpc > NUL 2>&1

Yeah i just found out its because of windows security
http://serverfault.com/questions/637743/...ed-on-user

So even without menu populated are you able to update it?
Keeping kodi open is not an option for me..
Reply
#9
Your link speaks of remote launching, but I was trying to launch Kodi locally using Task Scheduler on the PC that I wanted Kodi to run on.

I was unable to update the library until the menus populated Sad
4x R-Pi4b LibreELEC v10 | Aeon Nox: SiLVO | Flirc cases
Storage Synology DS411 | 4 x WD RED 6TB
Software MariaDB 10.4.19 | Filebot | Ember Media Manager
wiki (wiki) | First time user (wiki) | Debug_Log (wiki) | mysql (wiki) | artwork (wiki)
Reply
#10
(2016-08-24, 23:12)zerocool_ie Wrote: Your link speaks of remote launching, but I was trying to launch Kodi locally using Task Scheduler on the PC that I wanted Kodi to run on.

I was unable to update the library until the menus populated Sad

yeah your problem is different with mine.. Smile


Anyways i found a solution to my problem

Code:
C:\PSTools\psexec -i 2 -d -u username -p password \\server "C:\Program Files (x86)\Kodi\Kodi.exe"
"C:\Program Files\cURL\bin\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://kodiusername:kodipass@server:port/jsonrpc > NUL 2>&1

I was able to run Kodi and let it auto update, and set Kodi Callbacks to shutdown with this script once database is updated

Code:
taskkill /IM Kodi.exe

Hopefully this can be useful to everyoneSmile
Reply

Logout Mark Read Team Forum Stats Members Help
Updating kodi library without opening the gui0