[FIX] add purge to ensure that database is clear when dls complete

refactor_total
Brett Spaulding 3 years ago
parent 806c3b9a70
commit be7bf92f5c

@ -25,7 +25,8 @@ def process_downloads():
Album.write(album['id'], {'downloading': True}) Album.write(album['id'], {'downloading': True})
download_album(album) download_album(album)
else: else:
return # Sometimes the records are not being removed
Album.purge()
cron = BackgroundScheduler({'apscheduler.job_defaults.max_instances': 3}, daemon=True) cron = BackgroundScheduler({'apscheduler.job_defaults.max_instances': 3}, daemon=True)

@ -83,3 +83,6 @@ class Model:
def unlink(self, record_id): def unlink(self, record_id):
self.env.delete_by_id(record_id) self.env.delete_by_id(record_id)
return True return True
def purge(self):
self.env.purge()

@ -1,12 +1,5 @@
{ {
"version": 2, "version": 2,
"keys": [ "keys": [],
"album",
"artist",
"cover",
"downloaded",
"downloading",
"link"
],
"data": {} "data": {}
} }
Loading…
Cancel
Save