diff --git a/db/db.go b/db/db.go index 804ea8b..a6e4481 100644 --- a/db/db.go +++ b/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 -} \ No newline at end of file +}