Fix - Guide overlay not focusing currently-playing channel on open (#5435)

(cherry picked from commit ed796d63d0)
This commit is contained in:
WizardOfYendor authored and Niels van Velzen committed 2026-04-19 21:13:13 +02:00
1 parent 136a54ebc1
commit ed981175c6
5 files changed
+6 -6

No files matched your search

@@ -245,7 +245,7 @@ public class FullDetailsFragment extends Fragment implements RecordingIndicatorV
// the third condition accounts for a situation where a sync (dataRefresh) coincides with the end of playback
if (lastPlaybackTime != null && (lastPlaybackTime.isAfter(mLastUpdated) || Instant.now().toEpochMilli() - lastPlaybackTime.toEpochMilli() < 2000) && mBaseItem.getType() != BaseItemKind.MUSIC_ARTIST) {
BaseItemDto lastPlayedItem = dataRefreshService.getValue().getLastPlayedItem();
if (mBaseItem.getType() == BaseItemKind.EPISODE && lastPlayedItem != null && !mBaseItem.getId().equals(lastPlayedItem.getId().toString()) && lastPlayedItem.getType() == BaseItemKind.EPISODE) {
if (mBaseItem.getType() == BaseItemKind.EPISODE && lastPlayedItem != null && !mBaseItem.getId().equals(lastPlayedItem.getId()) && lastPlayedItem.getType() == BaseItemKind.EPISODE) {
Timber.i("Re-loading after new episode playback");
loadItem(lastPlayedItem.getId());
dataRefreshService.getValue().setLastPlayedItem(null); //blank this out so a detail screen we back up to doesn't also do this
@@ -240,7 +240,7 @@ public class LiveTvGuideFragment extends Fragment implements LiveTvGuide, View.O
View child = mChannels.getChildAt(i);
if (!(child instanceof GuideChannelHeader)) continue;
GuideChannelHeader gch = (GuideChannelHeader) child;
if (gch.getChannel().getId().equals(channelId.toString()))
if (gch.getChannel().getId().equals(channelId))
gch.refreshFavorite();
}
}
@@ -114,7 +114,7 @@ public class TvManager {
int i = 0;
for (BaseItemDto channel : allChannels) {
channelIds[i++] = channel.getId();
if (channel.getId().equals(last.toString())) ndx = i;
if (channel.getId().equals(last)) ndx = i;
}
}
@@ -467,7 +467,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
public void refreshFavorite(UUID channelId) {
for (int i = 0; i < tvGuideBinding.channels.getChildCount(); i++) {
GuideChannelHeader gch = (GuideChannelHeader) tvGuideBinding.channels.getChildAt(i);
if (gch.getChannel().getId().equals(channelId.toString()))
if (gch.getChannel().getId().equals(channelId))
gch.refreshFavorite();
}
}
@@ -875,7 +875,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
}
// put focus on the last tuned channel
if (channel.getId().equals(mFirstFocusChannelId.toString())) {
if (channel.getId().equals(mFirstFocusChannelId)) {
firstRow = row;
mFirstFocusChannelId = null; // only do this first time in not while paging around
}
@@ -188,7 +188,7 @@ public class PlaybackController implements PlaybackControllerNotifiable {
} else {
// Prefer the media source with the same id as the item
for (MediaSourceInfo mediaSource : mediaSources) {
if (UUIDSerializerKt.toUUIDOrNull(mediaSource.getId()).equals(item.getId())) {
if (item.getId().equals(UUIDSerializerKt.toUUIDOrNull(mediaSource.getId()))) {
return mediaSource;
}
}