Bug #5632
autorecs with duplicate handling set to "record if different episode number" don't take into account season number
0%
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
Updated by Flole Systems over 5 years 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.
Updated by Herbert Broeuschmeul over 5 years 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;
}
Updated by Flole Systems over 5 years 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;
}
Updated by Herbert Broeuschmeul over 5 years 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 ?
Updated by Flole Systems over 5 years 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?
Updated by Em Smith over 5 years ago
Since you're using 4.3, why not just use "unique" if you want to record unique programmes?
Updated by Herbert Broeuschmeul over 5 years 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 ?
Updated by Em Smith over 5 years 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?
Updated by Herbert Broeuschmeul over 5 years 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