Merge pull request #8883 from Douile/dev-enqueue-next-hide

Only show "Enqueue next" when in the middle of the queue
pull/9504/head
Stypox 2022-12-04 18:43:45 +01:00 zatwierdzone przez GitHub
commit 281ac13eed
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -252,10 +252,11 @@ public final class InfoItemDialog {
* @return the current {@link Builder} instance
*/
public Builder addEnqueueEntriesIfNeeded() {
if (PlayerHolder.getInstance().isPlayQueueReady()) {
final PlayerHolder holder = PlayerHolder.getInstance();
if (holder.isPlayQueueReady()) {
addEntry(StreamDialogDefaultEntry.ENQUEUE);
if (PlayerHolder.getInstance().getQueueSize() > 1) {
if (holder.getQueuePosition() < holder.getQueueSize() - 1) {
addEntry(StreamDialogDefaultEntry.ENQUEUE_NEXT);
}
}

Wyświetl plik

@ -92,6 +92,13 @@ public final class PlayerHolder {
return player.getPlayQueue().size();
}
public int getQueuePosition() {
if (player == null || player.getPlayQueue() == null) {
return 0;
}
return player.getPlayQueue().getIndex();
}
public void setListener(@Nullable final PlayerServiceExtendedEventListener newListener) {
listener = newListener;