From cb327f532beb7a683dfd2e08b323575f651eae3b Mon Sep 17 00:00:00 2001 From: BroodjeAap <david@broodjeaap.net> Date: Sun, 28 May 2023 08:23:15 +0000 Subject: [PATCH] actually fixed disable schedule filter -_- --- web/scraping.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/web/scraping.go b/web/scraping.go index b107f8a..e24fce2 100644 --- a/web/scraping.go +++ b/web/scraping.go @@ -1424,12 +1424,16 @@ func getFilterResultDisableSchedules(filter *Filter, web *Web, debug bool) { web.db.Model(&Filter{}).Where("watch_id = ? AND type = 'cron'", filter.WatchID).Update("Var2", "no") - entryID, exist := web.cronWatch[filter.ID] - if !exist { - return + var cronFilters []Filter + web.db.Model(&Filter{}).Where("watch_id = ? AND type = 'cron'", filter.WatchID).Find(&cronFilters) + for _, cronFilter := range cronFilters { + entryID, exist := web.cronWatch[cronFilter.ID] + if !exist { + return + } + web.cron.Remove(entryID) + delete(web.cronWatch, filter.ID) } - web.cron.Remove(entryID) - delete(web.cronWatch, filter.ID) } // getFilterResultEcho is a debug filter type, used to bootstrap some tests