2022-08-01, 14:02
Hi all,
I've got basic JSON calls working and get player state, etc. I'm now trying to retrieve items from the VideoLibrary.
Specifically I want to find items that have been marked as played. Previously I used to do this direct in MySQL storage engine, so I could query table "MyVideos119" (or whatever number) and the "files" table asking for anything with a greater than 0 playCount.
I'm trying to replicate this with JSON calls but strugging.
First question, should I be using api to VideoLibrary or Files?
I think using Files is what I need. By querying the Files.GetDirectory I get the files in that particular library/location:
/usr/bin/curl -v --user test:test --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory": "/RecordedTV/"}}' http://192.168.XX.1:8080/jsonrpc
As that returns:
{"file":"/RecordedTV/BBC-One-NE&C-HD-Eat-Well-for-Less_-2022-06-23-.ts","filetype":"file","label":"BBC-One-NE&C-HD-Eat-Well-for-Less_-2022-06-23-.ts","type":"unknown"}
But I'm missing how that then links up with the playcount and how to retrieve it, can anyone offer any pointers to where I can fetch that part?
Thanks!
I've got basic JSON calls working and get player state, etc. I'm now trying to retrieve items from the VideoLibrary.
Specifically I want to find items that have been marked as played. Previously I used to do this direct in MySQL storage engine, so I could query table "MyVideos119" (or whatever number) and the "files" table asking for anything with a greater than 0 playCount.
I'm trying to replicate this with JSON calls but strugging.
First question, should I be using api to VideoLibrary or Files?
I think using Files is what I need. By querying the Files.GetDirectory I get the files in that particular library/location:
/usr/bin/curl -v --user test:test --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory": "/RecordedTV/"}}' http://192.168.XX.1:8080/jsonrpc
As that returns:
{"file":"/RecordedTV/BBC-One-NE&C-HD-Eat-Well-for-Less_-2022-06-23-.ts","filetype":"file","label":"BBC-One-NE&C-HD-Eat-Well-for-Less_-2022-06-23-.ts","type":"unknown"}
But I'm missing how that then links up with the playcount and how to retrieve it, can anyone offer any pointers to where I can fetch that part?
Thanks!