aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-08-28 14:23:20 -0700
committerScott Jackson <daneren2005@gmail.com>2014-08-28 14:23:20 -0700
commit074545c1150b6424418739554fc00d35036d1da1 (patch)
treedf9af96abc9daa8014979f4445c3b2b3562548fc
parentcdb005b3d9d5fa8c837b228fb67fe87212d9a0b7 (diff)
downloaddsub-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.java5
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);