diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-28 14:23:20 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-28 14:23:20 -0700 |
commit | 074545c1150b6424418739554fc00d35036d1da1 (patch) | |
tree | df9af96abc9daa8014979f4445c3b2b3562548fc | |
parent | cdb005b3d9d5fa8c837b228fb67fe87212d9a0b7 (diff) | |
download | dsub-074545c1150b6424418739554fc00d35036d1da1.tar.gz dsub-074545c1150b6424418739554fc00d35036d1da1.tar.bz2 dsub-074545c1150b6424418739554fc00d35036d1da1.zip |
#385 lastCount needs to be items added, not possible adds
-rw-r--r-- | src/github/daneren2005/dsub/util/ShufflePlayBuffer.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java b/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java index 4f5e1893..5235a1f3 100644 --- a/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java +++ b/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java @@ -142,13 +142,14 @@ public class ShufflePlayBuffer { MusicDirectory songs = service.getRandomSongs(n, folder, genre, startYear, endYear, context, null); synchronized (buffer) { + lastCount = 0; for(MusicDirectory.Entry entry: songs.getChildren()) { if(!buffer.contains(entry)) { buffer.add(entry); + lastCount++; } } - Log.i(TAG, "Refilled shuffle play buffer with " + songs.getChildrenSize() + " songs."); - lastCount = songs.getChildrenSize(); + Log.i(TAG, "Refilled shuffle play buffer with " + lastCount + " songs."); // Cache buffer FileUtil.serialize(context, buffer, CACHE_FILENAME); |