Fix crash
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2020-09-04 21:18:55 +02:00
parent 19e6d9ef8e
commit 9107d75216

View File

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