From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Tue, 5 Dec 2017 20:09:30 +0000 (+0000) Subject: dvr: Fix autorec if it has a category but event has no category. (#4777). X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58439fdfa7a500ff7d0ff9c23d62772da52ff589;p=thirdparty%2Ftvheadend.git dvr: Fix autorec if it has a category but event has no category. (#4777). 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. --- diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index ae04f873b..3668aa6e0 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -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 &&