Don't included deleted songs in smart playlists. Fixes issue 1998

This commit is contained in:
David Sansome 2011-06-17 20:16:45 +00:00
parent 7415d85dce
commit 9d1fdeb87d

View File

@ -72,6 +72,11 @@ QString Search::ToSql(const QString& songs_table) const {
where_clauses << "(ROWID NOT IN (" + numbers + "))";
}
// We never want to include songs that have been deleted, but are still kept
// in the database in case the directory containing them has just been
// unmounted.
where_clauses << "unavailable = 0";
if (!where_clauses.isEmpty()) {
sql += " WHERE " + where_clauses.join(" AND ");
}