fix(scanner): improve refresh artists stats query

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-02-20 14:55:45 -05:00
parent dd4802c0c6
commit d4147c2330

View file

@ -295,10 +295,10 @@ with artist_role_counters as (
artist_total_counters as (
select mfa.artist_id,
'total' as role,
count(distinct mf.album) as album_count,
count(distinct mf.album_id) as album_count,
count(distinct mf.id) as count,
sum(mf.size) as size
from (select distinct artist_id, media_file_id
from (select artist_id, media_file_id
from main.media_file_artists) as mfa
join main.media_file mf on mfa.media_file_id = mf.id
group by mfa.artist_id