Recording "playcount" always zero
#16
Hi again and happy new year! Do you expect this is something which can get fixed? Or is it still unclear what exactly is going wrong?
Reply
#17
Happy new year to you too.

I think as you stated, adding support for Recording ID is the right way to do this for PlayList.Add and PlayList.Insert.

I assume you run Kodi on a Mac?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#18
@Buschel can you give me some example Playlist.Add and Playlist.Insert json curl commands both with and without recordingid?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#19
Quote:I assume you run Kodi on a Mac?
Kodi server is running under Linux, but the App which sends/receives the JSON commands is running on iOS or an iOS simulator on OS X. All commands are trying to insert, queue or play the same recording.

The following JSON commands are taken from the App. First block is the current (working) solution which uses paths. The second block is what is expected to work, using ids.

//--------------- Following are the working commands
// Insert using path
{"jsonrpc":"2.0","method":"Playlist.Insert","id":1,"params":{"playlistid":1,"position":0,"item":{"file":"pvr:\/\/recordings\/tv\/active\/3sat-Wetter (1601), TV%20(3sat%20HD), 20211022_171700, 1:0:0:0:0:0:0:0:0:0:\/media\/hdd\/movie\/20211022 1917 - 3sat HD - 3sat-Wetter.ts.pvr"}}}

// Queue using path
{"jsonrpc":"2.0","method":"Playlist.Add","id":1,"params":{"playlistid":1,"item":{"file":"pvr:\/\/recordings\/tv\/active\/3sat-Wetter (1601), TV%20(3sat%20HD), 20211022_171700, 1:0:0:0:0:0:0:0:0:0:\/media\/hdd\/movie\/20211022 1917 - 3sat HD - 3sat-Wetter.ts.pvr"}}}

// Playing (first delete current playlist, then add new item, then play playlist)
{"jsonrpc":"2.0","method":"Playlist.Clear","id":1,"params":{"playlistid":1}}
{"jsonrpc":"2.0","method":"Playlist.Add","id":1,"params":{"playlistid":1,"item":{"file":"pvr:\/\/recordings\/tv\/active\/3sat-Wetter (1601), TV%20(3sat%20HD), 20211022_171700, 1:0:0:0:0:0:0:0:0:0:\/media\/hdd\/movie\/20211022 1917 - 3sat HD - 3sat-Wetter.ts.pvr"}}}
{"jsonrpc":"2.0","method":"Player.Open","id":1,"params":{"options":{"shuffled":false},"item":{"playlistid":1,"position":0}}}

//--------------- What should work, but doesn't
// Insert
{"jsonrpc":"2.0","method":"Playlist.Insert","id":1,"params":{"playlistid":1,"position":0,"item":{"recordingid":25}}}
(Returns with error.)

// Queue
{"jsonrpc":"2.0","method":"Playlist.Add","id":1,"params":{"playlistid":1,"item":{"recordingid":25}}}
(Returns with error.)

// Play
{"jsonrpc":"2.0","method":"Playlist.Clear","id":1,"params":{"playlistid":1}}
{"jsonrpc":"2.0","method":"Playlist.Add","id":1,"params":{"playlistid":1,"item":{"recordingid":25}}}
(Player.Open is not called as above command returns with error.)
Reply
#20
Please try a test build from here: https://jenkins.kodi.tv/job/BuildMulti-PR/21431/

PR: https://github.com/xbmc/xbmc/pull/20796

It's hack to see if it's possible. If it works I'll find a better way to implement it.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#21
@phunkyfish iirc he‘s running kodi on linux mint. is there a jenkins .deb artifact to test?
Reply
#22
(2022-01-04, 23:28)howie-f Wrote: @phunkyfish iirc he‘s running kodi on linux mint. is there a jenkins .deb artifact to test?

No, we don't do test builds for Linux as there are far too many flavours. Maybe just run Kodi on the same Mac as running the emulator to test if it works. BTW the PR is for Nexus, we can't change the API version for Matrix I'm afraid.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#23
ok, built PR 20796 and had a successful test:
- {"jsonrpc":"2.0","method":"Playlist.Clear","id":1,"params":{"playlistid":1}} ----- result OK
- {"jsonrpc":"2.0","method":"Playlist.Insert","id":1,"params":{"playlistid":1,"position":0,"item":{"recordingid":2}}} -------- result OK
- {"jsonrpc":"2.0","method":"Player.Open","id":1,"params":{"options":{"shuffled":false},"item":{"playlistid":1,"position":0}}} -------- result OK ----- recording starts playing.

so even if it's hackish, seems to work ok. @Buschel let me know if further tests are desired, i'll keep that build for now
Reply
#24
(2022-01-05, 00:55)howie-f Wrote: ok, built PR 20796 and had a successful test:
- {"jsonrpc":"2.0","method":"Playlist.Clear","id":1,"params":{"playlistid":1}} ----- result OK
- {"jsonrpc":"2.0","method":"Playlist.Insert","id":1,"params":{"playlistid":1,"position":0,"item":{"recordingid":2}}} -------- result OK
- {"jsonrpc":"2.0","method":"Player.Open","id":1,"params":{"options":{"shuffled":false},"item":{"playlistid":1,"position":0}}} -------- result OK ----- recording starts playing.

so even if it's hackish, seems to work ok. @Buschel let me know if further tests are desired, i'll keep that build for now
I just encapsulated it a bit more but I think we are good. The important thing is that after it playing to the end of the video doesn't the playcount returned from the API get incremented?

@Buschel do you have example JSON to return playcount?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#25
I installed the dmg on the OS X and then added the Enigma2 Add-on. With your changes Kodi does now accept the INSERT and ADD command based on the recording id. The recording is added to the playlist and also the recording name and not the file name is reported. So far so good. Smile

A quick check was not showing any change of the play counter though -- not sure, if this was expected after your change.

Another open topic is that while playing a recording it will be great to receive more data after requesting "Player.GetItem". Currently the "type" in the response is "unknown" when playing a recording, and there is no "thumbnail" shared. For the App visualization it will be great, if either a valid "type" is defined (e.g. for music "song" is used) and/or a valid "thumbnail" (e.g. same as "icon" which typically holds the station logo) would be sent. Will this be possible?
Reply
#26
query playcount with : {"jsonrpc":"2.0","method":"PVR.GetRecordings","id":1,"params":{"properties":["title","playcount"]}}
it increased from 2 to 3 in my case, tested with the latest commit now
Reply
#27
(2022-01-05, 01:30)howie-f Wrote: query playcount with : {"jsonrpc":"2.0","method":"PVR.GetRecordings","id":1,"params":{"properties":["title","playcount"]}}
it increased from 2 to 3 in my case, tested with the latest commit now

Woohoo, looks like it’s working so!!!
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#28
Sorry, for the initial misleading info. I confirm playcount increase also works for me with your changes.
Reply
#29
(2022-01-05, 01:37)Buschel Wrote: Sorry, for the initial misleading info. I confirm playcount increase also works for me with your changes.

No worries, this should go into master soon-ish. Unfortunately as APIs for Matrix/Nexus have diverged it cannot be backported.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#30
(2022-01-05, 15:45)phunkyfish Wrote: No worries, this should go into master soon-ish. Unfortunately as APIs for Matrix/Nexus have diverged it cannot be backported.
Great, sounds good. Can you share with me from which API version on the changes will be in? I can then prepare the changes on the App side.

And sorry to bother you with this again: Did you see my question of the possibility to add a "thumbnail" and a "type" when responding to "Player.GetItem"?
Reply

Logout Mark Read Team Forum Stats Members Help
Recording "playcount" always zero0