2020-02-22, 03:17
Hello all,
I have an application that I'd like to mark all media (mostly video) as watched / played. Not all of it is assigned to TvShows or Movies or Music.
So, I was attempting to do so with the Files.GetDirectory call (https://kodi.wiki/view/JSON-RPC_API/v8#F...tDirectory), but it appears like even though I specify PlayCount as a property I want to be returned, it is not honored (unless I'm doing something wrong).
It seems very similar to what was observed on this thread: https://forum.kodi.tv/showthread.php?tid...pid2802360
Example:
$jsonRequest = '{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "directory": "smb://192.168.29.3/TV/Watched/", "media": "files", "properties" : ["playcount", "file"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": 1}'
$requestUri = [String]::Format("{0}?request={1}",$KODI_URI,$jsonRequest)
$webclient.DownloadString($requestUri)
{"id":1,"jsonrpc":"2.0","result":{"files":[
{"file":"smb://192.168.29.3/TV/Watched/Against The Rules/","filetype":"directory","label":"Against The Rules","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/American Gothic/","filetype":"directory","label":"American Gothic","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/The Americans (2013)/","filetype":"directory","label":"The Americans (2013)","type":"unknown"},
..
..
{"file":"smb://192.168.29.3/TV/Watched/Once in a Lifetime Sessions with Moby.mp4","filetype":"file","label":"Once in a Lifetime Sessions with Moby.mp4","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/Real Time with Bill Maher_ Anniversary Special.mp4","filetype":"file","label":"Real Time with Bill Maher_ Anniversary Special.mp4","type":"unknown"}
],"limits":{"end":87,"start":0,"total":87}}}
According to the documentation, the call takes List.Fields.Files as a parameter, that should allow playcount:
https://kodi.wiki/view/JSON-RPC_API/v8#L...elds.Files
Has anyone else hit this? Is there a workaround? Thanks in advance!
I have an application that I'd like to mark all media (mostly video) as watched / played. Not all of it is assigned to TvShows or Movies or Music.
So, I was attempting to do so with the Files.GetDirectory call (https://kodi.wiki/view/JSON-RPC_API/v8#F...tDirectory), but it appears like even though I specify PlayCount as a property I want to be returned, it is not honored (unless I'm doing something wrong).
It seems very similar to what was observed on this thread: https://forum.kodi.tv/showthread.php?tid...pid2802360
Example:
$jsonRequest = '{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "directory": "smb://192.168.29.3/TV/Watched/", "media": "files", "properties" : ["playcount", "file"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": 1}'
$requestUri = [String]::Format("{0}?request={1}",$KODI_URI,$jsonRequest)
$webclient.DownloadString($requestUri)
{"id":1,"jsonrpc":"2.0","result":{"files":[
{"file":"smb://192.168.29.3/TV/Watched/Against The Rules/","filetype":"directory","label":"Against The Rules","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/American Gothic/","filetype":"directory","label":"American Gothic","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/The Americans (2013)/","filetype":"directory","label":"The Americans (2013)","type":"unknown"},
..
..
{"file":"smb://192.168.29.3/TV/Watched/Once in a Lifetime Sessions with Moby.mp4","filetype":"file","label":"Once in a Lifetime Sessions with Moby.mp4","type":"unknown"},
{"file":"smb://192.168.29.3/TV/Watched/Real Time with Bill Maher_ Anniversary Special.mp4","filetype":"file","label":"Real Time with Bill Maher_ Anniversary Special.mp4","type":"unknown"}
],"limits":{"end":87,"start":0,"total":87}}}
According to the documentation, the call takes List.Fields.Files as a parameter, that should allow playcount:
https://kodi.wiki/view/JSON-RPC_API/v8#L...elds.Files
Has anyone else hit this? Is there a workaround? Thanks in advance!