enjoy: db_albums_get() should return only albums which files haven't been marked as deleted by lms

SVN revision: 62837
This commit is contained in:
Leandro Pereira 2011-08-25 22:10:20 +00:00
parent 7fc987f071
commit 70c40537b8
1 changed files with 8 additions and 1 deletions

View File

@ -1109,7 +1109,14 @@ db_albums_get(DB *db)
it->base.stmt_name = "albums_get";
it->base.stmt = _db_stmt_compile
(db, it->base.stmt_name,
"SELECT id, artist_id, name FROM audio_albums ORDER BY UPPER(name)");
"SELECT audio_albums.id, audio_albums.artist_id, audio_albums.name "
"FROM audio_albums, files, audios "
"WHERE "
" audios.id = files.id AND "
" audios.album_id = audio_albums.id AND "
" files.dtime = 0 "
"GROUP BY audio_albums.id "
"ORDER BY UPPER(name)");
if (!it->base.stmt)
{
free(it);