rsiebert/TVHClient

Duplicate detection method not being correctly set

Closed this issue · 10 comments

Editing a series within the app and changing the duplicate detection method results in the wrong method being stored in tvh.

The setting seems to be out by one in the list (eg 'record if different episode number' results in 'record if different subtitle'. The list on the app contains one more entry than the tvh web interface ('All: Record if EPG indicates it is a unique program'), which I suspect may be the root of the issue.

In the latest sources there are 15 entries for the duplicate detection. See https://github.com/tvheadend/tvheadend/blob/master/src/dvr/dvr_autorec.c#L1000
I have used this as a reference. Which server version do you have? Maybe it was less in an older version so I need to add some version check.

Yes, I was wondering if there was a potential issue with different versions of the server. I'm using 4.2.8.34-g24a2f59e9. What do you build against - I might consider upgrading?

The testserver I use is 4.3-1861~g2e61c1edc

The only latest change that I found for this list was introduced in the dvr.h file
The HTSP version is 30. So all servers below 30 should not support the "Record if EPG/XMLTV indicates it is a unique programme".

What is your server API version saying in the status screen?

Having a quick look at the dvr.h file, I wonder if there are other issues in this area? Tvheadend uses a enumerated type, and the numbers do not run in the order that they are listed. This makes sense as new additions to the list are given the next free value.

Looking at arrays.xml, it wonder if you are simply using the order in which the entries appear? I don't know enough about the API to know what is passed back and forth, but I suspect it is an index number. If this is the case, I think other entries will also fail (eg All: Record once per month has a value of 12, but is number 5 in your list)

If I've got this wrong feel free to shoot me down - I've only managed to grab a few moments to look at this, and may have completely missed something in the code.

I will change the order of the list in my app according to the index. I'll upload a test version here soon:

DVR_AUTOREC_RECORD_ALL = 0,
DVR_AUTOREC_RECORD_DIFFERENT_EPISODE_NUMBER = 1,
DVR_AUTOREC_RECORD_DIFFERENT_SUBTITLE = 2,
DVR_AUTOREC_RECORD_DIFFERENT_DESCRIPTION = 3,
DVR_AUTOREC_RECORD_ONCE_PER_WEEK = 4,
DVR_AUTOREC_RECORD_ONCE_PER_DAY = 5,
DVR_AUTOREC_LRECORD_DIFFERENT_EPISODE_NUMBER = 6,
DVR_AUTOREC_LRECORD_DIFFERENT_TITLE = 7,
DVR_AUTOREC_LRECORD_DIFFERENT_SUBTITLE = 8,
DVR_AUTOREC_LRECORD_DIFFERENT_DESCRIPTION = 9,
DVR_AUTOREC_LRECORD_ONCE_PER_WEEK = 10,
DVR_AUTOREC_LRECORD_ONCE_PER_DAY = 11,
DVR_AUTOREC_RECORD_ONCE_PER_MONTH = 12,
DVR_AUTOREC_LRECORD_ONCE_PER_MONTH = 13,
DVR_AUTOREC_RECORD_UNIQUE = 14,

Here is a 2.3.6-202 version with the new list order. I hope this fixes the issue and the other stuff still works. :-)

That seems to have fixed that particular issue (and I really like that you display the duplicate detection method on the series detail page).

One observation. After editing the duplicate detection method, the page that was displaying it is not updated. You have to move away and come back again to see that the change has taken place.

I'll close this for now. The issue with the update will be a separate issue.

Version 2.4.0 was released today