Project

General

Profile

Bug #5632

autorecs with duplicate handling set to "record if different episode number" don't take into account season number

Added by Herbert Broeuschmeul 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
PVR / DVR
Target version:
-
Start date:
2019-05-18
Due date:
% Done:

0%

Estimated time:
Found in version:
4.3
Affected Versions:

Description

Problem:

If you create an autorecs rule for a multi season tv show and manage duplicate handling using one of the "record if different episode number" option then the decision to record or not an episode will be based only on the episode number whatever the season number is.

Expected behavior:

Dedup only when the season number and the episode number are the same.

History

#1

Updated by Flole Systems 5 months ago

Fix would probably be to add the following lines in dvr_db.c after line 86

if (de->de_epnum.s_num && de2->de_epnum.s_num && de->de_epnum.s_num != de2->de_epnum.s_num)
    return 0;

Let me know if that works for you.

#2

Updated by Herbert Broeuschmeul 5 months ago

In dvr_db.c after line 1485 more something like

static int _dvr_duplicate_epnum(dvr_entry_t *de, dvr_entry_t *de2, void **aux)
{
  if (de->de_epnum && de2->de_epnum)
    return ! epg_episode_number_cmp(&(de->de_epnum), &(de2->de_epnum)) ;
  }
  return 0;
}

or

static int _dvr_duplicate_epnum(dvr_entry_t *de, dvr_entry_t *de2, void **aux)
{
  if (de->de_epnum && de2->de_epnum)
    return ! epg_episode_number_cmpfull (&(de->de_epnum), &(de2->de_epnum)) ;
  }
  return 0;
}

#3

Updated by Flole Systems 5 months ago

Sorry of course 1486, use latest master and simply add those lines.

It should be

static int _dvr_duplicate_epnum(dvr_entry_t *de, dvr_entry_t *de2, void **aux)
{
  if (de->de_epnum.s_num && de2->de_epnum.s_num && de->de_epnum.s_num != de2->de_epnum.s_num)
    return 0;
  if (de->de_epnum.e_num && de2->de_epnum.e_num)
    return de->de_epnum.e_num == de2->de_epnum.e_num;
  if (de->de_epnum.text && de2->de_epnum.text)
    return strcmp(de->de_epnum.text, de2->de_epnum.text) == 0;
  return 0;
}
#4

Updated by Herbert Broeuschmeul 5 months ago

Won't work if episodes can have 0 as season number... e.g. specials.
Just for my education, what's wrong with the epg_episode_number_cmp functions ?

#5

Updated by Flole Systems 5 months ago

Actually nothing as far as I can see, I just had a different approach to it. Have you tested your suggestion? Does it work?

#6

Updated by Em Smith 5 months ago

Since you're using 4.3, why not just use "unique" if you want to record unique programmes?

#7

Updated by Herbert Broeuschmeul 5 months ago

Em Smith wrote:

Since you're using 4.3, why not just use "unique" if you want to record unique programmes?

"record if different episode number" was working in version 4.2, so I was thinking it was a regression bug...
Do you mean it doesn't worth to be corrected because of the new "unique" feature ?

#8

Updated by Em Smith 5 months ago

No-one mentioned earlier that it worked differently on 4.2. So, yes it should be fixed if a regression. My "unique" suggestion was before I knew "episode" should compare season as well as episode.

I think it broke last January as part of the #4811 changes where the episode information is stored differently so we can send it to Kodi.

Does the cmp work correctly if programme A has no episode data but programme B has episode data?

#9

Updated by Herbert Broeuschmeul 5 months ago

For me the cmp functions are ok, you can verify by yourself in epg.c:
https://github.com/tvheadend/tvheadend/blob/466a0143195a0a0f15c58d4bbd93c57b13caaccd/src/epg.c#L434-L465

Also available in: Atom PDF