fix(scanner): filter folders by num_audio_files to ensure accurate statistics

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-06-23 10:26:15 -04:00
parent 177de7269b
commit cfa1d7fa81
2 changed files with 8 additions and 3 deletions
@@ -30,7 +30,7 @@ update library set
join artist a on la.artist_id = a.id
where la.library_id = library.id and a.missing = 0
),
total_folders = (select count(*) from folder where library_id = library.id and missing = 0),
total_folders = (select count(*) from folder where library_id = library.id and missing = 0 and num_audio_files > 0),
total_files = (
select ifnull(sum(num_audio_files + num_playlists + json_array_length(image_files)),0)
from folder where library_id = library.id and missing = 0