fix: exclude removed records

This commit is contained in:
Simon Ding
2025-04-23 10:58:38 +08:00
parent 269a5bf030
commit 98823e251b

View File

@@ -534,7 +534,7 @@ func (c *client) SetEpisodeStatus(id int, status episode.Status) error {
func (c *client) IsEpisodeDownloadingOrDownloaded(id int) bool {
ep, _ := c.GetEpisodeByID(id)
his := c.ent.History.Query().Where(history.EpisodeNumsNotNil()).AllX(context.Background())
his := c.ent.History.Query().Where(history.EpisodeNumsNotNil(), history.StatusNEQ(history.StatusRemoved)).AllX(context.Background())
for _, h := range his {
if !slices.Contains(h.EpisodeNums, ep.EpisodeNumber) {
continue