Skip to content

Commit 8b400b4

Browse files
Refactor notifying method in PlayQueue.
1 parent cacce6d commit 8b400b4

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void onSuccess(@NonNull final T result) {
8282
public void onError(@NonNull final Throwable e) {
8383
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
8484
isComplete = true;
85-
append(); // Notify change
85+
notifyChange();
8686
}
8787
};
8888
}
@@ -117,7 +117,7 @@ public void onSuccess(
117117
public void onError(@NonNull final Throwable e) {
118118
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
119119
isComplete = true;
120-
append(); // Notify change
120+
notifyChange();
121121
}
122122
};
123123
}

app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,10 @@ public synchronized void offsetIndex(final int offset) {
257257
}
258258

259259
/**
260-
* Appends the given {@link PlayQueueItem}s to the current play queue.
261-
*
262-
* @see #append(List items)
263-
* @param items {@link PlayQueueItem}s to append
260+
* Notifies that a change has occurred.
264261
*/
265-
public synchronized void append(@NonNull final PlayQueueItem... items) {
266-
append(List.of(items));
262+
public synchronized void notifyChange() {
263+
broadcast(new AppendEvent(0));
267264
}
268265

269266
/**

0 commit comments

Comments
 (0)