Refactor notifying method in PlayQueue.

This commit is contained in:
Isira Seneviratne 2022-07-20 04:36:54 +05:30
parent cacce6d2d0
commit 8b400b48f7
2 changed files with 5 additions and 8 deletions

View File

@ -82,7 +82,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<StreamInfoItem>>
public void onError(@NonNull final Throwable e) {
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
isComplete = true;
append(); // Notify change
notifyChange();
}
};
}
@ -117,7 +117,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<StreamInfoItem>>
public void onError(@NonNull final Throwable e) {
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
isComplete = true;
append(); // Notify change
notifyChange();
}
};
}

View File

@ -257,13 +257,10 @@ public abstract class PlayQueue implements Serializable {
}
/**
* Appends the given {@link PlayQueueItem}s to the current play queue.
*
* @see #append(List items)
* @param items {@link PlayQueueItem}s to append
* Notifies that a change has occurred.
*/
public synchronized void append(@NonNull final PlayQueueItem... items) {
append(List.of(items));
public synchronized void notifyChange() {
broadcast(new AppendEvent(0));
}
/**