diff --git a/components/extras/ExtrasRowList.bs b/components/extras/ExtrasRowList.bs index 70b886c3c..7a0cf1268 100644 --- a/components/extras/ExtrasRowList.bs +++ b/components/extras/ExtrasRowList.bs @@ -35,6 +35,7 @@ sub updateSize() end sub sub loadParts(data as object) + m.extrasGrp = m.top.getParent().findNode("extrasGrp") m.top.parentId = data.id m.people = data.People m.LoadAdditionalPartsTask.itemId = m.top.parentId @@ -42,6 +43,7 @@ sub loadParts(data as object) end sub sub loadPersonVideos(personId) + m.extrasGrp = m.top.getParent().findNode("extrasGrp") m.personId = personId m.LoadMoviesTask.itemId = m.personId m.LoadMoviesTask.observeField("content", "onMoviesLoaded") @@ -114,7 +116,7 @@ sub onLikeThisLoaded() m.SpecialFeaturesTask.control = "RUN" end sub -function onSpecialFeaturesLoaded() +sub onSpecialFeaturesLoaded() data = m.SpecialFeaturesTask.content m.SpecialFeaturesTask.unobserveField("content") if data <> invalid and data.count() > 0 @@ -132,8 +134,8 @@ function onSpecialFeaturesLoaded() addRowSize([462, 372]) end if - return m.top.content -end function + showOrHideMe() +end sub sub onMoviesLoaded() data = m.LoadMoviesTask.content @@ -179,6 +181,8 @@ sub onSeriesLoaded() m.top.content.appendChild(row) end if m.top.visible = true + + showOrHideMe() end sub function buildRow(rowTitle as string, items, imgWdth = 0) @@ -218,6 +222,17 @@ sub addRowSize(newRow) m.top.rowItemSize = newSizeArray end sub +' don't show popup panel if there is nothing to show +sub showOrHideMe() + if isValid(m.top.content) + if m.top.content.getChildCount() = 0 + m.extrasGrp.visible = false + else + m.extrasGrp.visible = true + end if + end if +end sub + sub onRowItemSelected() m.top.selectedItem = m.top.content.getChild(m.top.rowItemSelected[0]).getChild(m.top.rowItemSelected[1]) end sub diff --git a/components/home/HomeRows.bs b/components/home/HomeRows.bs index d691cb154..b41c7ed1c 100644 --- a/components/home/HomeRows.bs +++ b/components/home/HomeRows.bs @@ -687,6 +687,7 @@ end sub sub itemSelected() m.selectedRowItem = m.top.rowItemSelected + m.global.launchSource = "home" m.top.selectedItem = m.top.content.getChild(m.top.rowItemSelected[0]).getChild(m.top.rowItemSelected[1]) 'Prevent the selected item event from double firing diff --git a/components/movies/MovieDetails.bs b/components/movies/MovieDetails.bs index 5812f4c47..56ab0ba03 100644 --- a/components/movies/MovieDetails.bs +++ b/components/movies/MovieDetails.bs @@ -403,7 +403,7 @@ function onKeyEvent(key as string, press as boolean) as boolean m.options.setFocus(true) end if - if key = "down" and m.buttonGrp.isInFocusChain() + if key = "down" and m.buttonGrp.isInFocusChain() and m.extrasGrp.visible = true m.top.lastFocus = m.extrasGrid m.extrasGrid.setFocus(true) m.top.findNode("VertSlider").reverse = false diff --git a/components/tvshows/TVEpisodeRow.bs b/components/tvshows/TVEpisodeRow.bs index 5782723f9..62cfb143e 100644 --- a/components/tvshows/TVEpisodeRow.bs +++ b/components/tvshows/TVEpisodeRow.bs @@ -6,11 +6,28 @@ sub init() m.top.showRowLabel = [false] + m.top.observeField("selectItemId", "onItemSelected") + updateSize() m.top.setFocus(true) end sub +sub onItemSelected() + Id = m.top.selectItemId + + if Id <> invalid and Id <> "" and m.top.objects <> invalid + for i = 0 to m.top.objects.items.count() - 1 + item = m.top.objects.items[i] + if item.id = Id + m.top.jumpToItem = i + return + end if + end for + end if +end sub + + sub updateSize() m.top.translation = [450, 180] diff --git a/components/tvshows/TVEpisodeRow.xml b/components/tvshows/TVEpisodeRow.xml index 0e14bc3a8..9885529c9 100644 --- a/components/tvshows/TVEpisodeRow.xml +++ b/components/tvshows/TVEpisodeRow.xml @@ -4,5 +4,8 @@ + + + \ No newline at end of file diff --git a/components/tvshows/TVEpisodeRowWithOptions.bs b/components/tvshows/TVEpisodeRowWithOptions.bs index d982d82c7..6c68fde79 100644 --- a/components/tvshows/TVEpisodeRowWithOptions.bs +++ b/components/tvshows/TVEpisodeRowWithOptions.bs @@ -4,9 +4,15 @@ sub init() m.rows = m.top.findNode("tvEpisodeRow") m.tvListOptions = m.top.findNode("tvListOptions") + m.top.observeField("selectItemId", "onItemSelected") m.rows.observeField("doneLoading", "rowsDoneLoading") end sub +sub onItemSelected() + Id = m.top.selectItemId + m.rows.selectItemId = Id +end sub + sub setupRows() objects = m.top.objects m.rows.objects = objects diff --git a/components/tvshows/TVEpisodeRowWithOptions.xml b/components/tvshows/TVEpisodeRowWithOptions.xml index 008720972..6b6c904d4 100644 --- a/components/tvshows/TVEpisodeRowWithOptions.xml +++ b/components/tvshows/TVEpisodeRowWithOptions.xml @@ -8,5 +8,8 @@ + + + \ No newline at end of file diff --git a/components/tvshows/TVEpisodes.bs b/components/tvshows/TVEpisodes.bs index 95b98f02e..916a1fca6 100644 --- a/components/tvshows/TVEpisodes.bs +++ b/components/tvshows/TVEpisodes.bs @@ -6,6 +6,7 @@ import "pkg:/source/api/sdk.bs" sub init() m.top.optionsAvailable = false + m.top.observeField("selectItemId", "onItemSelected") m.rows = m.top.findNode("picker") m.poster = m.top.findNode("seasonPoster") @@ -25,6 +26,11 @@ sub setSeasonLoading() m.top.overhangTitle = tr("Loading...") end sub +sub onItemSelected() + Id = m.top.selectItemId + m.rows.selectItemId = Id +end sub + ' Updates the visibility of the Extras button based on if this season has any extra features sub setExtraButtonVisibility() if isValid(m.top.extrasObjects) and isValidAndNotEmpty(m.top.extrasObjects.items) @@ -73,6 +79,7 @@ end function ' OnScreenShown: Callback function when view is presented on screen ' sub OnScreenShown() + if m.isFirstRun m.isFirstRun = false return @@ -80,6 +87,7 @@ sub OnScreenShown() m.tvEpisodeRow.setFocus(true) m.top.refreshSeasonDetailsData = not m.top.refreshSeasonDetailsData + end sub ' Handle navigation input from the remote and act on it diff --git a/components/tvshows/TVEpisodes.xml b/components/tvshows/TVEpisodes.xml index 1c0cfefc8..2213b49dc 100644 --- a/components/tvshows/TVEpisodes.xml +++ b/components/tvshows/TVEpisodes.xml @@ -19,6 +19,9 @@ + + + \ No newline at end of file diff --git a/components/video/OSD.bs b/components/video/OSD.bs index 95928db45..6d9d0d480 100644 --- a/components/video/OSD.bs +++ b/components/video/OSD.bs @@ -41,7 +41,21 @@ end sub ' sub onProgressPercentageChanged() m.videoPositionTime.text = secondsToHuman(m.top.positionTime, true) - m.videoRemainingTime.text = secondsToHuman(m.top.remainingPositionTime, true) + + osdmode = m.global.session.user.settings["ui.general.osdremainingtime"] + if m.global.session.user.settings["ui.design.hideclock"] + ' in order to honor the hide clocks setting + osdmode = "remaining" + end if + + if osdmode = "remaining" + m.videoRemainingTime.text = secondsToHuman(m.top.remainingPositionTime, true) + else if osdmode = "timeofday" + m.videoRemainingTime.text = secondsToEndTime(m.top.remainingPositionTime) + else if osdmode = "both" + m.videoRemainingTime.text = secondsToHuman(m.top.remainingPositionTime, true) + " | " + secondsToEndTime(m.top.remainingPositionTime) + end if + m.progressBar.width = m.progressBarBackground.width * m.top.progressPercentage end sub diff --git a/components/video/OSD.xml b/components/video/OSD.xml index 4093701d0..e80eb64e6 100644 --- a/components/video/OSD.xml +++ b/components/video/OSD.xml @@ -34,7 +34,7 @@