From c81a9b102fbdd4687ecd1b189353d8fc5d3908d0 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 17 Apr 2016 10:24:27 +0200 Subject: [PATCH] Refactor QueueEvent --- .../danoeh/antennapod/activity/MainActivity.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 1e1f908c5..8599eb4f4 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -688,15 +688,13 @@ public class MainActivity extends AppCompatActivity implements NavDrawerActivity public void onEvent(QueueEvent event) { Log.d(TAG, "onEvent(" + event + ")"); - switch(event.action) { - case ADDED: - case ADDED_ITEMS: - case SET_QUEUE: - case REMOVED: - case IRREVERSIBLE_REMOVED: - case CLEARED: - loadData(); + // we are only interested in the number of queue items, not download status or position + if(event.action == QueueEvent.Action.DELETED_MEDIA || + event.action == QueueEvent.Action.SORTED || + event.action == QueueEvent.Action.MOVED) { + return; } + loadData(); } public void onEventMainThread(ProgressEvent event) {