Fixed anime deletion (closes #240)

This commit is contained in:
Eduard Urbach 2019-10-06 10:37:59 +09:00
parent 63b5e637e4
commit 7c0df89cba
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -111,7 +111,13 @@ func (anime *Anime) Delete() error {
DB.Delete("AnimeRelations", anime.ID)
// Delete anime episodes
DB.Delete("AnimeEpisodes", anime.ID)
for _, episode := range anime.Episodes() {
err := episode.Delete()
if err != nil {
return err
}
}
// Delete anime list items
for animeList := range StreamAnimeLists() {