Hardened the indexing for blink-182
This commit is contained in:
@@ -21,7 +21,9 @@ def find_db():
|
||||
def load_artists(db_path):
|
||||
conn = sqlite3.connect(db_path)
|
||||
rows = conn.execute(
|
||||
"SELECT mbid, COALESCE(name, mbid) FROM artists ORDER BY name"
|
||||
"SELECT a.mbid, COALESCE(a.name, a.mbid) FROM artists a "
|
||||
"LEFT JOIN tracks t ON t.artist_mbid = a.mbid "
|
||||
"GROUP BY a.mbid ORDER BY COUNT(t.path) DESC, a.name"
|
||||
).fetchall()
|
||||
conn.close()
|
||||
return rows # [(mbid, display_name), ...]
|
||||
|
||||
Reference in New Issue
Block a user