Project

General

Profile

Bug #3025

Multiple recordings of the same event have the same ID

Added by Sam Stenvall almost 6 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Start date:
2015-07-23
Due date:
% Done:

0%

Estimated time:
Found in version:
master
Affected Versions:

Description

This causes problem for Kodi since the addon (pvr.hts) blindly trusts that the IDs from the server are unique. See this log snippet:

DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:2130620946, state:scheduled, title:Die Truman Show, desc:  Satire über Medienmanipulation, in der ein Versicherungsagent ohne sein Wissen seit 30 Jahren Star einer weltweit live übertragenen Fernseh-Seifenoper ist., error:none
DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:2130620946, state:recording, title:Die Truman Show, desc:  Satire über Medienmanipulation, in der ein Versicherungsagent ohne sein Wissen seit 30 Jahren Star einer weltweit live übertragenen Fernseh-Seifenoper ist., error:none

These are two separate recordings.

History

#1

Updated by Sam Stenvall over 5 years ago

@perexg can you point me to the code that generates these IDs so I can take a stab at fixing this? I would not like to add a workaround for this to pvr.hts.

#2

Updated by Jaroslav Kysela over 5 years ago

Which ID do you use? "id" or "eventId" ?

#4

Updated by Jaroslav Kysela over 5 years ago

This id is unique. It looks like a bug somewhere else. The id uniqueness is checked in src/idnode.c - idnode_insert() function. This fcn should abort with "Id node collision" message if no unique ids is available after 5 retries.

#5

Updated by Sam Stenvall over 5 years ago

The log snippet comes from a user so I'm not sure how to replicate it. I have noticed though that if you record an event, then stop the recording and record it again, two recordings will be created (obviously) but you can only play the first one. I think that could be related, I'll try to grab some new logs.

#6

Updated by Jaroslav Kysela over 5 years ago

I looked to the kodi log from the user (pvr.hts issue) and to the tvh code. There is a check which prevents to add two duplicate recordings. Perhaps, the pvr.hts is confused by this ? But TVH should return success = 0 response in that case.

TVH shows "delete entry .. start time .. scheduled for recording by .. (duplicate with ..)" in log when the duplication is detected.

#7

Updated by Sam Stenvall over 5 years ago

Not really sure what you're saying here. Judging by the log tvheadend definitely sends two items with the same ID, that's what I'm worried about.

#8

Updated by B C over 5 years ago

just by looking at the log snippet, one line says scheduled, the other recording......

#9

Updated by Sam Stenvall over 5 years ago

Yes, but they still have the same ID.

#10

Updated by Sam Stenvall over 5 years ago

@perexg so are you saying it shouldn't be possible to record the same program twice?

#11

Updated by B C over 5 years ago

maybe I don't understand exactly the problem. When I schedule a recording (just added manually in tvh webif, which starts immediately), I get the following in the log:
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:scheduled, title:Test, desc:, error:none
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none

I do expect the recording id to be the same for the schedule and the recording

#12

Updated by B C over 5 years ago

BTW i get this twice:
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none
13:08:54 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none

one second apart but with the same T:140103611565824

#13

Updated by Sam Stenvall over 5 years ago

The "T" is irrelevant.

#14

Updated by B C over 5 years ago

ok, but still I did schedule only one recording and see the same as your log snippet, so IMHO no dublicate id

#15

Updated by Jaroslav Kysela over 5 years ago

I also don't understand the issue. Basically, if htsp client enters a new recording - the addDvrEntry method is issued from client. If tvh detects the duplicate parameters (same user, same DVR config, identical start time), it will respond with "success" = 0 reply.

Then we have the async replies from the tvh server - dvrEntryAdd , dvrEntryUpdate . These messages are generated when a new DVR entry is created / updated. I'm not able to determine which reply the pvr.hts plugin logs. The update async reply might be generated multiple times to notify client about the state changes.

Also available in: Atom PDF