A decentralized music tracking and discovery platform built on AT Protocol 🎵

feat: update get_artist_listeners to include album_artist in query and grouping

+9 -3
+9 -3
crates/analytics/src/handlers/artists.rs
··· 402 402 s.user_id, 403 403 s.track_id, 404 404 t.artist, 405 + t.album_artist, 405 406 t.title as track_title, 406 407 t.uri as track_uri, 407 408 COUNT(*) as play_count 408 409 FROM scrobbles s 409 410 JOIN tracks t ON s.track_id = t.id 410 - WHERE t.artist = ? 411 - GROUP BY s.user_id, s.track_id, t.artist, t.title, t.uri 411 + WHERE t.artist = ? OR t.album_artist = ? 412 + GROUP BY s.user_id, s.track_id, t.artist, t.title, t.uri, t.album_artist 412 413 ), 413 414 user_top_tracks AS ( 414 415 SELECT ··· 468 469 )?; 469 470 470 471 let listeners = stmt.query_map( 471 - [&artist.name, &limit.to_string(), &offset.to_string()], 472 + [ 473 + &artist.name, 474 + &artist.name, 475 + &limit.to_string(), 476 + &offset.to_string(), 477 + ], 472 478 |row| { 473 479 Ok(ArtistListener { 474 480 artist: row.get(0)?,