Refactor QueueEvent

This commit is contained in:
Martin Fietz 2016-04-17 10:24:27 +02:00
parent 5328bd2b06
commit c81a9b102f
1 changed files with 6 additions and 8 deletions

View File

@ -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) {