summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r--src/de/danoeh/antennapod/feed/FeedManager.java13
-rw-r--r--src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/feed/FeedManager.java b/src/de/danoeh/antennapod/feed/FeedManager.java
index 230e0087a..2ee06328d 100644
--- a/src/de/danoeh/antennapod/feed/FeedManager.java
+++ b/src/de/danoeh/antennapod/feed/FeedManager.java
@@ -4,6 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -890,7 +891,17 @@ public class FeedManager {
public void clearQueue(final Context context) {
if (AppConfig.DEBUG)
Log.d(TAG, "Clearing queue");
- queue.clear();
+ Iterator<FeedItem> iter = queue.iterator();
+ while (iter.hasNext()) {
+ FeedItem item = iter.next();
+ if (item.getState() != FeedItem.State.PLAYING) {
+ iter.remove();
+ } else {
+ if (AppConfig.DEBUG)
+ Log.d(TAG,
+ "FeedItem is playing and is therefore not removed from the queue");
+ }
+ }
eventDist.sendQueueUpdateBroadcast();
dbExec.execute(new Runnable() {
diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java
index b1bc5a8e2..64bcb1cf2 100644
--- a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java
+++ b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java
@@ -80,7 +80,7 @@ public class FeedItemMenuHandler {
}
boolean isInQueue = manager.isInQueue(selectedItem);
- if (!isInQueue) {
+ if (!isInQueue || isPlaying) {
mi.setItemVisibility(R.id.remove_from_queue_item, false);
}
if (!(!isInQueue && selectedItem.getMedia() != null)) {