fix: remove episodes no media id

This commit is contained in:
Simon Ding
2024-09-29 16:16:05 +08:00
parent 6fcc569bf2
commit 98d14befa9

View File

@@ -649,8 +649,7 @@ func (c *Client) GetMovingNamingFormat() string {
return s
}
func (c *Client) CleanAllDanglingEpisodes() error {
_, err := c.ent.Episode.Delete().Where(episode.MediaID(0)).Exec(context.Background())
_, err := c.ent.Episode.Delete().Where(episode.Not(episode.HasMedia())).Exec(context.Background())
return err
}
}