diff --git a/app.py b/app.py index 41bf64b..29e5493 100644 --- a/app.py +++ b/app.py @@ -24,8 +24,9 @@ def process_downloads(): print(album) Album.write(album['id'], {'downloading': True}) download_album(album) - else: - return + else: + # Sometimes the records are not being removed + Album.purge() cron = BackgroundScheduler({'apscheduler.job_defaults.max_instances': 3}, daemon=True) diff --git a/database.py b/database.py index 5797968..7f32058 100644 --- a/database.py +++ b/database.py @@ -83,3 +83,6 @@ class Model: def unlink(self, record_id): self.env.delete_by_id(record_id) return True + + def purge(self): + self.env.purge() diff --git a/database/album.json b/database/album.json index 65fae68..738f013 100644 --- a/database/album.json +++ b/database/album.json @@ -1,12 +1,5 @@ { "version": 2, - "keys": [ - "album", - "artist", - "cover", - "downloaded", - "downloading", - "link" - ], + "keys": [], "data": {} } \ No newline at end of file