mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-12 04:30:46 +08:00
fix: exclude removed records
This commit is contained in:
2
db/db.go
2
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
|
||||
|
||||
Reference in New Issue
Block a user