mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-27 13:07:47 +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 {
|
func (c *client) IsEpisodeDownloadingOrDownloaded(id int) bool {
|
||||||
ep, _ := c.GetEpisodeByID(id)
|
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 {
|
for _, h := range his {
|
||||||
if !slices.Contains(h.EpisodeNums, ep.EpisodeNumber) {
|
if !slices.Contains(h.EpisodeNums, ep.EpisodeNumber) {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user