mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed removal of empty artists
This commit is contained in:
parent
31c6fe6243
commit
c8f678b600
@ -632,13 +632,11 @@ def clean_db():
|
|||||||
if a2+a1>0: log(f"Deleted {a2} tracks without scrobbles ({a1} track artist entries)")
|
if a2+a1>0: log(f"Deleted {a2} tracks without scrobbles ({a1} track artist entries)")
|
||||||
|
|
||||||
### Delete artists that have no tracks
|
### Delete artists that have no tracks
|
||||||
# we actually don't wanna do that as it will break collection artists
|
a3 = conn.execute(sql.text('''
|
||||||
# that don't have songs themselves
|
delete from artists where id not in (select artist_id from trackartists) and id not in (select target_artist from associated_artists)
|
||||||
#a3 = conn.execute(sql.text('''
|
''')).rowcount
|
||||||
# delete from artists where id not in (select artist_id from trackartists)
|
|
||||||
#''')).rowcount
|
if a3>0: log(f"Deleted {a3} artists without tracks")
|
||||||
#
|
|
||||||
#if a3>0: log(f"Deleted {a3} artists without tracks")
|
|
||||||
|
|
||||||
### Delete tracks that have no artists (delete their scrobbles first)
|
### Delete tracks that have no artists (delete their scrobbles first)
|
||||||
a4 = conn.execute(sql.text('''
|
a4 = conn.execute(sql.text('''
|
||||||
|
Loading…
Reference in New Issue
Block a user