"Mark as unwatched" and "reset resume position"
#1
How to do operations for videofile, such "Mark as unwatched" and "reset resume position" via python?
Reply
#2
Anybody, lazy guys!!!!
Reply
#3
Calling us forum users lazy is not going to score points....
Server: Ubuntu Server 22TB HDD running SAMBA
Kodi: 4 Raspberry Pi 3 running Libreelec -  on the main PC - running Linux Mint
My Setup thread |
Reply
#4
Here you go:

https://kodi.wiki/view/JSON-RPC_API/v9

Everything you need to know to do what you want is in there.  Just construct a JSON call to Kodi with the right parameters and you're all set.
Reply
#5
Need ful python example , please with "Mark as unwatched" and "reset resume position"
Reply
#6
(2019-09-03, 05:25)pkscout Wrote: Just construct a JSON call to Kodi with the right parameters and you're all set.
How?
Reply
#7
"Lazy guy"

https://codedocs.xyz/xbmc/xbmc/group__py...9ed84ed846
https://kodi.wiki/view/JSON-RPC_API/v9
https://kodi.wiki/view/JSON-RPC_API/Examples
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#8
If your Python add-on uses streamed video items (the kind of item that points back to the add-on itself using the plugin:// protocol, where you will then use xbmcplugin.setResolvedUrl(...) to start playback), then the JSON-RPC commands cannot be used to change these items yet. 
See here for more: https://github.com/xbmc/xbmc/issues/15897
Reply
#9
python:
response = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "VideoLibrary.SetMovieDetails", "params": {"movieid" : %d, "playcount": %d , "resume": {"position": %d}   }} ' % (ID, count, positionInSecond))

A video is considered Watched if playcount is greater than 0.  so you can set both count and positionInSeconds to zero.
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply

Logout Mark Read Team Forum Stats Members Help
"Mark as unwatched" and "reset resume position"0