Update library automatic
#1
Hi

Maybe a dumb question, but is it possible to make Kodi update the library when it wakes up from suspend?
I know it is possible from startup, but not from suspend state.

Kindly
Petter :-)
Many thanks for all the effort YOU all do! THANKS! :-)
nVidia Shield TV (2015), Samsung QE75Q70R and Yamaha RX-V767
Reply
#2
Yep. Use a suspend hook and a jsonrpc command.
Reply
#3
Oki

It`s that something simple to do?
I can`t seem to find it in the forum nor the wiki.

I run Kodibuntu
Petter :-)
Many thanks for all the effort YOU all do! THANKS! :-)
nVidia Shield TV (2015), Samsung QE75Q70R and Yamaha RX-V767
Reply
#4
you add a script that does what you want to /etc/pm/sleep.d/
note that that script has to act on an input parameter.

Code:
case $1 in
     suspend|suspend_hybrid|hibernate)
    # this is executed on suspend
        ;;
     resume|thaw)
    # this is executed on resume
        # your json command goes here
        ;;
esac
Reply
#5
safe a file inside /etc/pm/sleep.d/
with this command:
Code:
case $1 in
     suspend|suspend_hybrid|hibernate)
    # this is executed on suspend
        ;;
     resume|thaw)
    # this is executed on resume
        #  curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'   http://localhost:9191/jsonrpc
        ;;
esac

This will update on resume from suspend?
How do I save it, kind of file?
Petter :-)
Many thanks for all the effort YOU all do! THANKS! :-)
nVidia Shield TV (2015), Samsung QE75Q70R and Yamaha RX-V767
Reply
#6
I have tried this, but I can`t seem to understand.
Petter :-)
Many thanks for all the effort YOU all do! THANKS! :-)
nVidia Shield TV (2015), Samsung QE75Q70R and Yamaha RX-V767
Reply
#7
Simply check the startup scan option in video settings. It will fire up the scan on resume.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#8
Thank you very much. That worked nicely :-)

I have used it like that before, but did not know that it work from suspend.
I`m only used it when I run Kodi on Windows, and then it started from scratch every time.

Thanks again!
Petter :-)
Many thanks for all the effort YOU all do! THANKS! :-)
nVidia Shield TV (2015), Samsung QE75Q70R and Yamaha RX-V767
Reply

Logout Mark Read Team Forum Stats Members Help
Update library automatic0