From 900ce51af0cb71a34d9b1ab33b8f63bd536ae04c Mon Sep 17 00:00:00 2001 From: krateng Date: Fri, 18 Feb 2022 08:13:31 +0100 Subject: [PATCH] Fixed database cleanup --- maloja/database/sqldb.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/maloja/database/sqldb.py b/maloja/database/sqldb.py index 90e2672..d4a6a92 100644 --- a/maloja/database/sqldb.py +++ b/maloja/database/sqldb.py @@ -575,12 +575,14 @@ def clean_db(): log(f"Deleted {a2} tracks without scrobbles ({a1} track artist entries)") - ### Delete artists that have no tracks (will remove defined associates, not sure if leaving like this) - a3 = conn.execute(sql.text(''' - delete from artists where id not in (select artist_id from trackartists) - ''')).rowcount - - log(f"Deleted {a3} artists without tracks") + ### Delete artists that have no tracks + # we actually don't wanna do that as it will break collection artists + # that don't have songs themselves + #a3 = conn.execute(sql.text(''' + # delete from artists where id not in (select artist_id from trackartists) + #''')).rowcount + # + #log(f"Deleted {a3} artists without tracks") ### Delete tracks that have no artists (delete their scrobbles first) a4 = conn.execute(sql.text('''