Use url comparison between queue items when disabling preloading

From #4562: Disable player stream preloading only if the current stream is going to be replaced for sure (see this). equals() was implemented for PlayQueueItems, so that (only) the url is compared when checking them.
pull/6712/head
Stypox 2021-07-21 18:07:26 +02:00
rodzic 4a2bd7bd7b
commit fa8630ddae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -813,7 +813,7 @@ public final class VideoDetailFragment
@NonNull final String newTitle,
@Nullable final PlayQueue newQueue) {
if (isPlayerAvailable() && newQueue != null && playQueue != null
&& !Objects.equals(newQueue.getItem(), playQueue.getItem())) {
&& playQueue.getItem() != null && !playQueue.getItem().getUrl().equals(newUrl)) {
// Preloading can be disabled since playback is surely being replaced.
player.disablePreloadingOfCurrentTrack();
}