Recording "playcount" always zero
#1
Hi,

while working on the PVR control of the Kodi Remote for iOS I was recognizing that I always receive a "playcount" of "0" via the Kodi API, even when the recording was just played via Kodi. Is this a known issue or a limitation of the PVR add-on?

Kodi: Kodi 19.1 on Linux
Add-on: Enigma2 Client 7.411
PVR: Vu+ Solo2

Thanks,
Buschel
Reply
#2
Do you also have a playcount of zero in Kodi? Or just via the API?

Once you have Enigma2 running it should work. What image are you using?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#3
I just retested again, and I get the same result in Kodi UI and via API. But: If I trigger playback of a recording from the Kodi UI, the playcount increases. If I trigger the playback via the API, the playcount does not increase. You still need the VTi image version I am running?
Reply
#4
The version of OpenWebIf should be enough. Once it’s at least 1.3.0 it should be ok.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#5
(2021-10-16, 23:01)Buschel Wrote: I just retested again, and I get the same result in Kodi UI and via API. But: If I trigger playback of a recording from the Kodi UI, the playcount increases.

This statement is conflicting. Does it work in the UI or not?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#6
(2021-10-17, 00:05)phunkyfish Wrote: The version of OpenWebIf should be enough. Once it’s at least 1.3.0 it should be ok.
When I call OpenWebif via my browser the version shows as "Materialize design - Version: 1.2.0". The VTi version is "VTi 15.0.0 (2021-02-08-vti-master (9849f8edd))".
(2021-10-17, 00:09)phunkyfish Wrote:
(2021-10-16, 23:01)Buschel Wrote: I just retested again, and I get the same result in Kodi UI and via API. But: If I trigger playback of a recording from the Kodi UI, the playcount increases.

This statement is conflicting. Does it work in the UI or not?
Let me rephrase:
Use case 1: I am triggering playback of a PVR recording from the Kodi UI. After the playback finished the recording is marked as "watched" in the Kodi UI, and I also get playcount=1 from the JSON API.
Use case 2: I am triggering playback of a PVR recording via the JSON API. After the playback finished the recording is marked as "not watched" in the Kodi UI, and I also get playcount=0 from the JSON API.

So, Kodi UI and API report the same playcount. But Kodi only increases the playcount, if the playback is triggered via the Kodi UI. It does not increase the playcount when the playback is triggered via the JSON API.

Hoping this is makes the observation clear now.
Reply
#7
Yes, it makes it clear thanks. Let me see if I can find a reason why it does doesn’t work from JSON.

Question: if you play from the kodi UI twice does the playcount report as 2?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#8
Hmmm, if the code path follows through: https://github.com/xbmc/xbmc/blob/97936f...#L755-L770 then it should be working. My guess is it must be using a different path.

Are you starting playback using recordingid?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#9
I made some observations on play count here since I found it confusing going through how it worked https://github.com/kodi-pvr/pvr.nextpvr/...s.cpp#L518 Also check here where it actually gets bumped https://github.com/kodi-pvr/pvr.nextpvr/...s.cpp#L544

It also different if you let Kodi manage the play count in sqlite/mysql

Martin
Reply
#10
(2021-10-17, 13:56)phunkyfish Wrote: Question: if you play from the kodi UI twice does the playcount report as 2?
Yes, the count increases each time when played from Kodi UI.
(2021-10-17, 14:06)phunkyfish Wrote: My guess is it must be using a different path.

Are you starting playback using recordingid?
I agree, this is not the first time I see different behaviour for different paths. And: No, the Remote App`s JSON command is first clearing the playlist, then adding a file ("file": "path-to-recording") and finally starts playing this playlist. "Playlist.Add" does not support "recordingid".
Reply
#11
It is even more interesting. If I am playing back a recording via "file": "path-to-recording" Kodi internally increases the playcount, but does not report this to the outside via the JSON API (I cannot see the playcount directly in Kodi UI, I just see the recording marked as "watched"). After I then play the file via "recordingid": id the reported playcount is including the playbacks which were triggered via "file": as well.

Example:
1. play-via-file -> playcount=0
2. play-via-file -> playcount=0
3. play-via-id -> playcount=3
4. play-via-file -> playcount=3
5. play-via-id -> playcount=5

A positive side effect of using play-via-id is that I get more details like plot or description via Player.GetItem. Sadly it is not an option for the Remote App to call play-via-id as it violates the concept of adding all items to a playlist and play from there. Overall it would be good the add support for recordingid to Playlist.Add and Playlist.Insert. How would I raise such a feature request?
Reply
#12
(2021-10-17, 15:34)Buschel Wrote: It is even more interesting. If I am playing back a recording via "file": "path-to-recording" Kodi internally increases the playcount, but does not report this to the outside via the JSON API (I cannot see the playcount directly in Kodi UI, I just see the recording marked as "watched"). After I then play the file via "recordingid": id the reported playcount is including the playbacks which were triggered via "file": as well.

Example:
1. play-via-file -> playcount=0
2. play-via-file -> playcount=0
3. play-via-id -> playcount=3
4. play-via-file -> playcount=3
5. play-via-id -> playcount=5

A positive side effect of using play-via-id is that I get more details like plot or description via Player.GetItem. Sadly it is not an option for the Remote App to call play-via-id as it violates the concept of adding all items to a playlist and play from there. Overall it would be good the add support for recordingid to Playlist.Add and Playlist.Insert. How would I raise such a feature request?

If it’s PVR specific functionality you want the by-id as will definitely call the PVR addon route to play it.

If you play from the URL is it the pvr:// URL you are using or the resolved to the real URL?

I can have a look at playlist.add/insert.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#13
(2021-10-17, 17:46)phunkyfish Wrote: If it’s PVR specific functionality you want the by-id as will definitely call the PVR addon route to play it.
Sorry, I am confused. Can you explain in other words?
(2021-10-17, 17:46)phunkyfish Wrote: If you play from the URL is it the pvr:// URL you are using or the resolved to the real URL?
When playing via file the pvr:// URL is used.
Reply
#14
Ah, sorry. I thought maybe you were using http URL to play the recording hence the first statement.

I think I know what is happening. Under the hood recordings are just video items. It appears the count is correct using either method but the PVR backend only gets informed when using the recording ID. As the pvr:// url is being used it really should work for both. I’ll see if I can figure why it’s not working.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#15
Hmmm, so it looks the code path will always be: https://github.com/xbmc/xbmc/blob/97936f...s.cpp#L681

If this is the case then it's the player that processes the playlist so the issue must be there where pvr:// is not calling the PVR addon to inform the playcount increase. @ksooo any ideas?

Issue reported in iOS remote app: https://github.com/xbmc/Official-Kodi-Re...issues/430
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply

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