From e6dd92f3e4eb62d4abe9d49ad9af0b8a63000d77 Mon Sep 17 00:00:00 2001 From: Christopher Eby Date: Tue, 13 Mar 2012 15:45:34 -0500 Subject: [PATCH] Only trim random songs in addSongs when in random mode --- src/org/kreed/vanilla/SongTimeline.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/org/kreed/vanilla/SongTimeline.java b/src/org/kreed/vanilla/SongTimeline.java index 6ac29a0f..1a2dd734 100644 --- a/src/org/kreed/vanilla/SongTimeline.java +++ b/src/org/kreed/vanilla/SongTimeline.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Christopher Eby + * Copyright (C) 2012 Christopher Eby * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -616,14 +616,15 @@ public final class SongTimeline { switch (mode) { case MODE_ENQUEUE: case MODE_ENQUEUE_POS_FIRST: - case MODE_ENQUEUE_ID_FIRST: { - int j = timeline.size(); - while (--j > mCurrentPos) { - if (timeline.get(j).isRandom()) - timeline.remove(j); + case MODE_ENQUEUE_ID_FIRST: + if (mFinishAction == FINISH_RANDOM) { + int j = timeline.size(); + while (--j > mCurrentPos) { + if (timeline.get(j).isRandom()) + timeline.remove(j); + } } break; - } case MODE_PLAY_NEXT: timeline.subList(mCurrentPos + 1, timeline.size()).clear(); break;