Skip to content

Commit

Permalink
fix: 优化EPG查询和解析。
Browse files Browse the repository at this point in the history
  • Loading branch information
super321 committed Jan 17, 2025
1 parent 9fc9ccb commit ce10dc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion internal/app/iptv/hwctc/epg.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ func (c *Client) GetAllChannelProgramList(ctx context.Context, channels []iptv.C
continue
}

epg = append(epg, *progList)
if progList != nil && len(progList.DateProgramList) > 0 {
epg = append(epg, *progList)
}
}

return epg, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/app/iptv/hwctc/epg_gdhdpublic.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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)
continue
break
}

dateProgramList = append(dateProgramList, *dateProgram)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/iptv/hwctc/epg_vsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
continue
break
}

dateProgramList = append(dateProgramList, iptv.DateProgram{
Expand Down

0 comments on commit ce10dc4

Please sign in to comment.