From 8232b528f5e51399d6d224fcc802c887840751a8 Mon Sep 17 00:00:00 2001 From: superant Date: Mon, 27 Jan 2025 12:01:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96EPG=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=92=8C=E8=A7=A3=E6=9E=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/app/iptv/hwctc/epg_gdhdpublic.go | 3 ++- internal/app/iptv/hwctc/epg_vsp.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/app/iptv/hwctc/epg_gdhdpublic.go b/internal/app/iptv/hwctc/epg_gdhdpublic.go index be91dbb..008f6a0 100644 --- a/internal/app/iptv/hwctc/epg_gdhdpublic.go +++ b/internal/app/iptv/hwctc/epg_gdhdpublic.go @@ -29,6 +29,7 @@ type gdhdpublicChannelProgramList struct { func (c *Client) getGdhdpublicChannelProgramList(ctx context.Context, token *Token, channel *iptv.Channel) (*iptv.ChannelProgramList, error) { // 获取未来一天的日期 tomorrow := time.Now().AddDate(0, 0, 1) + tomorrow = time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), 0, 0, 0, 0, tomorrow.Location()) // 根据当前频道的时移范围,预估EPG的查询时间范围(加上未来一天) epgBackDay := int(channel.TimeShiftLength.Hours()/24) + 1 @@ -50,7 +51,7 @@ func (c *Client) getGdhdpublicChannelProgramList(ctx context.Context, token *Tok return nil, err } c.logger.Sugar().Warnf("Failed to get the program list for channel %s on %s. Error: %v", channel.ChannelName, dateStr, err) - break + continue } dateProgramList = append(dateProgramList, *dateProgram) diff --git a/internal/app/iptv/hwctc/epg_vsp.go b/internal/app/iptv/hwctc/epg_vsp.go index dce3ca5..3d4a40c 100644 --- a/internal/app/iptv/hwctc/epg_vsp.go +++ b/internal/app/iptv/hwctc/epg_vsp.go @@ -98,7 +98,7 @@ func (c *Client) getVspChannelProgramList(ctx context.Context, token *Token, cha return nil, err } c.logger.Sugar().Warnf("Failed to get the program list for channel %s on %s. Error: %v", channel.ChannelName, startDate.Format("20060102"), err) - break + continue } dateProgramList = append(dateProgramList, iptv.DateProgram{