mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Adjusted DB cleanup to account for albums
This commit is contained in:
parent
d860e19b54
commit
e18dffbd2f
@ -1236,11 +1236,16 @@ def clean_db(dbconn=None):
|
|||||||
# tracks with no scrobbles (trackartist entries first)
|
# tracks with no scrobbles (trackartist entries first)
|
||||||
"from trackartists where track_id in (select id from tracks where id not in (select track_id from scrobbles))",
|
"from trackartists where track_id in (select id from tracks where id not in (select track_id from scrobbles))",
|
||||||
"from tracks where id not in (select track_id from scrobbles)",
|
"from tracks where id not in (select track_id from scrobbles)",
|
||||||
# artists with no tracks
|
# artists with no tracks AND no albums
|
||||||
"from artists where id not in (select artist_id from trackartists) and id not in (select target_artist from associated_artists)",
|
"from artists where id not in (select artist_id from trackartists) \
|
||||||
|
and id not in (select target_artist from associated_artists) \
|
||||||
|
and id not in (select artist_id from albumartists)",
|
||||||
# tracks with no artists (scrobbles first)
|
# tracks with no artists (scrobbles first)
|
||||||
"from scrobbles where track_id in (select id from tracks where id not in (select track_id from trackartists))",
|
"from scrobbles where track_id in (select id from tracks where id not in (select track_id from trackartists))",
|
||||||
"from tracks where id not in (select track_id from trackartists)"
|
"from tracks where id not in (select track_id from trackartists)",
|
||||||
|
# albums with no tracks (albumartist entries first)
|
||||||
|
"from albumartists where album_id in (select id from albums where id not in (select album_id from tracks))",
|
||||||
|
"from albums where id not in (select album_id from tracks)"
|
||||||
]
|
]
|
||||||
|
|
||||||
for d in to_delete:
|
for d in to_delete:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user