]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Fix season/episode unique test when recording.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Fri, 16 Nov 2018 09:17:53 +0000 (09:17 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 19 Nov 2018 12:28:24 +0000 (13:28 +0100)
The test for season/episode numbers the same has become broken during
the changeover of types from string to int. So it was only checking
episode numbers, meaning that S02E01 would not record if S01E01 was
available.

src/dvr/dvr_db.c

index 35242d6ee128243c0b84c9a3fc8124526d748a71..169d5b940f5a7e225025178fe51981a223c61c77 100644 (file)
@@ -1606,8 +1606,9 @@ static int _dvr_duplicate_unique_match(dvr_entry_t *de1, dvr_entry_t *de2, void
    * AND episode are present since OTA often have just "Ep 1" without
    * giving the season.
    */
-  if (de1->de_epnum.e_num && de2->de_epnum.e_num)
-    return de1->de_epnum.e_num == de2->de_epnum.e_num ? DUP : NOT_DUP;
+  if (de1->de_epnum.s_num && de1->de_epnum.e_num &&
+      de2->de_epnum.s_num && de2->de_epnum.e_num)
+    return de1->de_epnum.s_num == de2->de_epnum.s_num && de1->de_epnum.e_num == de2->de_epnum.e_num ? DUP : NOT_DUP;
 
   /* Only one has season and episode? Then can't be a dup with the
    * other one that doesn't have season+episode