]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Fix autorec if it has a category but event has no category. (#4777).
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Tue, 5 Dec 2017 20:09:30 +0000 (20:09 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 10 Dec 2017 15:40:50 +0000 (16:40 +0100)
Although we use a drop-down list for autorec categories, if the
user has no categories enabled (such as OTA) and creates an autorec
with a category then it would match all events.

Now we fix it that events without a category can never match an
autorec with categories.

Issue: #4777.

src/dvr/dvr_autorec.c

index ae04f873b9aaf337e3633a6eb7fe908598517a1c..3668aa6e0d31ee48e6cead450811d129064d0b90 100644 (file)
@@ -222,6 +222,11 @@ autorec_cmp(dvr_autorec_entry_t *dae, epg_broadcast_t *e)
       return 0;
     if (dae->dae_cat3 && *dae->dae_cat3 && !string_list_contains_string(e->category, dae->dae_cat3))
       return 0;
+  } else if ((dae->dae_cat1 && *dae->dae_cat1) ||
+             (dae->dae_cat2 && *dae->dae_cat2) ||
+             (dae->dae_cat3 && *dae->dae_cat3)) {
+    /* No category in event but autorec has category, so no match. */
+    return 0;
   }
 
   if(dae->dae_start >= 0 && dae->dae_start_window >= 0 &&