Bug #5632
open
autorecs with duplicate handling set to "record if different episode number" don't take into account season number
Added by Herbert Broeuschmeul almost 6 years ago.
Updated almost 6 years ago.
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.
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.
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;
}
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;
}
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 ?
Actually nothing as far as I can see, I just had a different approach to it. Have you tested your suggestion? Does it work?
Since you're using 4.3, why not just use "unique" if you want to record unique programmes?
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 ?
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?
Also available in: Atom
PDF