only return data for items we have data

This commit is contained in:
Adrian Ulrich 2015-08-14 19:40:05 +02:00
parent c44395757e
commit cf5fbb2dba

View File

@ -85,7 +85,7 @@ public class PlayCountsHelper extends SQLiteOpenHelper {
ArrayList<Long> payload = new ArrayList<Long>(); ArrayList<Long> payload = new ArrayList<Long>();
SQLiteDatabase dbh = getReadableDatabase(); SQLiteDatabase dbh = getReadableDatabase();
Cursor cursor = dbh.rawQuery("SELECT type_id FROM "+TABLE_PLAYCOUNTS+" WHERE type="+MediaUtils.TYPE_SONG+" ORDER BY playcount DESC limit "+limit, null); Cursor cursor = dbh.rawQuery("SELECT type_id FROM "+TABLE_PLAYCOUNTS+" WHERE type="+MediaUtils.TYPE_SONG+" AND playcount != 0 ORDER BY playcount DESC limit "+limit, null);
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
payload.add(cursor.getLong(0)); payload.add(cursor.getLong(0));