Fix crash on delete (2)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2020-10-01 16:59:15 +02:00
parent 7b11eeffef
commit 3a38f7ed6d

View File

@ -108,13 +108,9 @@ def list_animes(url_filters='nyaa,yggtorrent'):
def remove_garbage(link): def remove_garbage(link):
title = link.title title = link.title
if title: if title and not len(title.links):
if not len(title.links): db.session.delete(title)
db.session.delete(title) db.session.commit()
db.session.commit()
if not len(title.folder.titles):
db.session.delete(title.folder)
db.session.commit()
@app.route('/admin', methods=['GET', 'POST']) @app.route('/admin', methods=['GET', 'POST'])