From 1fd6cf1a2f2569fb5db381d902d67527caae3b94 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Fri, 30 Jun 2023 11:56:03 +0300 Subject: [PATCH] Pull request 1901: 5946-fix-blocked-services-client-schedule Updates #5946. Squashed commit of the following: commit cd6ba613fae56d05a2e51ae1a65e9fcf4a39899e Author: Stanislav Chzhen Date: Fri Jun 30 11:27:52 2023 +0300 home: fix blocked services client schedule --- internal/home/clientshttp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/home/clientshttp.go b/internal/home/clientshttp.go index 8028164a..38ea666d 100644 --- a/internal/home/clientshttp.go +++ b/internal/home/clientshttp.go @@ -9,6 +9,7 @@ import ( "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/filtering" + "github.com/AdguardTeam/AdGuardHome/internal/schedule" "github.com/AdguardTeam/AdGuardHome/internal/whois" ) @@ -118,13 +119,18 @@ func (clients *clientsContainer) jsonToClient(cj clientJSON, prev *Client) (c *C } } + weekly := schedule.EmptyWeekly() + if prev != nil { + weekly = prev.BlockedServices.Schedule.Clone() + } + c = &Client{ safeSearchConf: safeSearchConf, Name: cj.Name, BlockedServices: &filtering.BlockedServices{ - Schedule: prev.BlockedServices.Schedule.Clone(), + Schedule: weekly, IDs: cj.BlockedServices, },