mirror of
https://github.com/krateng/maloja.git
synced 2025-04-15 16:30:32 +03:00
Fixed database cleanup
This commit is contained in:
parent
e980efa731
commit
900ce51af0
@ -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('''
|
||||
|
Loading…
x
Reference in New Issue
Block a user