From 98823e251b535b772fd49d36a87ffe5589cd9e01 Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Wed, 23 Apr 2025 10:58:38 +0800 Subject: [PATCH] fix: exclude removed records --- db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 343e1fd..5d843ac 100644 --- a/db/db.go +++ b/db/db.go @@ -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