Fix loading StreamInfo twice on first VideoDetailFragment opening

This commit is contained in:
Stypox 2025-01-26 12:39:07 +01:00
parent 83f8141fe7
commit ffe26d882b
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23

View file

@ -452,8 +452,12 @@ public final class NavigationHelper {
if (fragment instanceof VideoDetailFragment && fragment.isVisible()) {
onVideoDetailFragmentReady.run((VideoDetailFragment) fragment);
} else {
// Specify no videoUrl here, otherwise the VideoDetailFragment will start loading the
// video automatically if it's the first time it is being opened, but then
// onVideoDetailFragmentReady will kick in and start another loading process.
// See VideoDetailFragment.wasCleared() and its usage in doInitialLoadLogic().
final VideoDetailFragment instance = VideoDetailFragment
.getInstance(serviceId, url, title, playQueue);
.getInstance(serviceId, null, title, playQueue);
instance.setAutoPlay(autoPlay);
defaultTransaction(fragmentManager)