mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-07 02:27:40 +08:00
fix: remove episodes no media id
This commit is contained in:
5
db/db.go
5
db/db.go
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user