Skip to content

Commit

Permalink
Merge branch 'unstable' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
jkim2492 authored Feb 21, 2023
2 parents 1fd21b7 + a809f8a commit 45dc9e5
Show file tree
Hide file tree
Showing 51 changed files with 6,713 additions and 332 deletions.
8 changes: 6 additions & 2 deletions bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
"locale/**/*.*",
"settings/*.*"
],
"plugins": [ "@rokucommunity/bslint" ],
"plugins": [
"@rokucommunity/bslint"
],
"diagnosticFilters": [
"**/roku_modules/**/*"
"**/roku_modules/**/*",
"**/testFramework/*",
"**/tests/*"
]
}
21 changes: 12 additions & 9 deletions components/ItemGrid/GridItem.brs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ sub init()

m.itemText.translation = [0, m.itemPoster.height + 7]

m.alwaysShowTitles = get_user_setting("itemgrid.alwaysShowTitles") = "true"
m.itemText.visible = m.alwaysShowTitles
m.gridTitles = get_user_setting("itemgrid.gridTitles")
m.itemText.visible = m.gridTitles = "showalways"

' Add some padding space when Item Titles are always showing
if m.alwaysShowTitles then m.itemText.maxWidth = 250
if m.itemText.visible then m.itemText.maxWidth = 250

'Parent is MarkupGrid and it's parent is the ItemGrid
m.topParent = m.top.GetParent().GetParent()
Expand All @@ -43,10 +43,12 @@ sub itemContentChanged()
m.itemIcon.uri = itemData.iconUrl
m.itemText.text = itemData.Title
else if itemData.type = "Series"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if

Expand Down Expand Up @@ -131,16 +133,17 @@ end sub
'Display or hide title Visibility on focus change
sub focusChanged()
if m.top.itemHasFocus = true
m.itemText.visible = true
m.itemText.repeatCount = -1
m.posterMask.scale = [1, 1]
else
m.itemText.visible = m.alwaysShowTitles
m.itemText.repeatCount = 0
if m.topParent.alphaActive = true
m.posterMask.scale = [0.85, 0.85]
end if
end if
if m.gridTitles = "showonhover"
m.itemText.visible = m.top.itemHasFocus
end if
end sub

'Hide backdrop and text when poster loaded
Expand Down
10 changes: 9 additions & 1 deletion components/ItemGrid/MovieLibraryView.brs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ sub loadInitialItems()
m.itemGrid.numRows = "3"
m.selectedMovieOverview.visible = false
m.infoGroup.visible = false
m.top.showItemTitles = get_user_setting("itemgrid.movieGridTitles")
m.top.showItemTitles = get_user_setting("itemgrid.gridTitles")
if LCase(m.top.showItemTitles) = "hidealways"
m.itemGrid.itemSize = "[230, 315]"
m.itemGrid.rowHeights = "[315]"
Expand Down Expand Up @@ -371,6 +371,10 @@ sub ItemDataLoaded(msg)

m.loading = false
m.spinner.visible = false
' Return focus to options menu if it was opened while library was loading
if m.options.visible
m.options.setFocus(true)
end if
return
end if

Expand Down Expand Up @@ -413,6 +417,10 @@ sub ItemDataLoaded(msg)
end if

m.spinner.visible = false
' Return focus to options menu if it was opened while library was loading
if m.options.visible
m.options.setFocus(true)
end if
end sub

'
Expand Down
32 changes: 32 additions & 0 deletions components/ItemGrid/MusicArtistGridItem.brs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sub init()
m.itemPoster = m.top.findNode("itemPoster")
m.postTextBackground = m.top.findNode("postTextBackground")
m.posterText = m.top.findNode("posterText")
m.posterText.font.size = 30
m.backdrop = m.top.findNode("backdrop")
Expand All @@ -14,11 +15,25 @@ sub init()
m.itemPoster.loadDisplayMode = m.topParent.imageDisplayMode
end if

m.gridTitles = get_user_setting("itemgrid.gridTitles")
m.posterText.visible = false
m.postTextBackground.visible = false

end sub

sub itemContentChanged()
m.backdrop.blendColor = "#101010"

m.posterText.visible = false
m.postTextBackground.visible = false

if isValid(m.topParent.showItemTitles)
if LCase(m.topParent.showItemTitles) = "showalways"
m.posterText.visible = true
m.postTextBackground.visible = true
end if
end if

itemData = m.top.itemContent

if not isValid(itemData) then return
Expand All @@ -38,6 +53,23 @@ sub itemContentChanged()
if m.itemPoster.loadStatus <> "ready"
m.backdrop.visible = true
end if
if m.top.itemHasFocus then focusChanged()
end sub

'Display or hide title Visibility on focus change
sub focusChanged()
if m.top.itemHasFocus = true
m.posterText.repeatCount = -1
else
m.posterText.repeatCount = 0
end if

if isValid(m.topParent.showItemTitles)
if LCase(m.topParent.showItemTitles) = "showonhover"
m.posterText.visible = m.top.itemHasFocus
m.postTextBackground.visible = m.posterText.visible
end if
end if
end sub

'Hide backdrop and text when poster loaded
Expand Down
3 changes: 3 additions & 0 deletions components/ItemGrid/MusicLibraryView.brs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ sub loadInitialItems()
m.sortAscending = false
end if

m.top.showItemTitles = get_user_setting("itemgrid.gridTitles")

if LCase(m.top.parentItem.json.type) = "musicgenre"
m.itemGrid.translation = "[96, 60]"
m.loadItemsTask.itemType = "MusicAlbum"
Expand All @@ -143,6 +145,7 @@ sub loadInitialItems()
m.loadItemsTask.itemId = m.top.parentItem.parentFolder
else if LCase(m.view) = "artistspresentation" or LCase(m.options.view) = "artistspresentation"
m.loadItemsTask.genreIds = ""
m.top.showItemTitles = "hidealways"
else if LCase(m.view) = "artistsgrid" or LCase(m.options.view) = "artistsgrid"
m.loadItemsTask.genreIds = ""
else
Expand Down
2 changes: 1 addition & 1 deletion components/ItemGrid/MusicLibraryView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
</children>
<interface>
<field id="HomeLibraryItem" type="string"/>
<field id="View" type="string"/>
<field id="parentItem" type="node" onChange="loadInitialItems" />
<field id="selectedItem" type="node" alwaysNotify="true" />
<field id="quickPlayNode" type="node" alwaysNotify="true" />
<field id="imageDisplayMode" type="string" value="scaleToZoom" />
<field id="AlphaSelected" type="string" alias="AlphaMenu.itemAlphaSelected" alwaysNotify="true" onChange="onItemAlphaSelected" />
<field id="alphaActive" type="boolean" value="false" />
<field id="showItemTitles" type="string" value="showonhover" />
<field id="jumpToItem" type="integer" value="" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
Expand Down
21 changes: 8 additions & 13 deletions components/JFVideo.brs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sub init()
m.nextEpisodeButton = m.top.findNode("nextEpisode")
m.nextEpisodeButton.text = tr("Next Episode")
m.nextEpisodeButton.setFocus(false)
m.nextupbuttonseconds = get_user_setting("playback.nextupbuttonseconds", "30")

m.showNextEpisodeButtonAnimation = m.top.findNode("showNextEpisodeButton")
m.hideNextEpisodeButtonAnimation = m.top.findNode("hideNextEpisodeButton")
Expand Down Expand Up @@ -95,7 +96,11 @@ end sub
'
'Update count down text
sub updateCount()
m.nextEpisodeButton.text = tr("Next Episode") + " " + Int(m.top.runTime - m.top.position).toStr()
nextEpisodeCountdown = Int(m.top.runTime - m.top.position)
if nextEpisodeCountdown < 0
nextEpisodeCountdown = 0
end if
m.nextEpisodeButton.text = tr("Next Episode") + " " + nextEpisodeCountdown.toStr()
end sub

'
Expand Down Expand Up @@ -147,11 +152,10 @@ sub onState(msg)
m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding
else
' If an error was encountered, Display dialog
dialog = createObject("roSGNode", "Dialog")
dialog = createObject("roSGNode", "PlaybackDialog")
dialog.title = tr("Error During Playback")
dialog.buttons = [tr("OK")]
dialog.message = tr("An error was encountered while playing this item.")
dialog.observeField("buttonSelected", "dialogClosed")
m.top.getScene().dialog = dialog
end if

Expand Down Expand Up @@ -231,11 +235,10 @@ sub bufferCheck(msg)
m.top.callFunc("refresh")
else
' If buffering has stopped Display dialog
dialog = createObject("roSGNode", "Dialog")
dialog = createObject("roSGNode", "PlaybackDialog")
dialog.title = tr("Error Retrieving Content")
dialog.buttons = [tr("OK")]
dialog.message = tr("There was an error retrieving the data for this item from the server.")
dialog.observeField("buttonSelected", "dialogClosed")
m.top.getScene().dialog = dialog

' Stop playback and exit player
Expand All @@ -246,14 +249,6 @@ sub bufferCheck(msg)

end sub

'
' Clean up on Dialog Closed
sub dialogClosed(msg)
sourceNode = msg.getRoSGNode()
sourceNode.unobserveField("buttonSelected")
sourceNode.close = true
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if key = "OK" and m.nextEpisodeButton.hasfocus() and not m.top.trickPlayBar.visible
Expand Down
10 changes: 6 additions & 4 deletions components/ListPoster.brs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ sub itemContentChanged() as void
itemData = m.top.itemContent
m.title.text = itemData.title

if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if

Expand Down
2 changes: 1 addition & 1 deletion components/OverviewDialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<StdDlgTitleArea id="titleArea" />
<StdDlgContentArea id="contentArea">
<StdDlgTextItem id="description"
namedTextStyle="secondary" />
namedTextStyle="normal" />
</StdDlgContentArea>
</children>
</component>
Loading

0 comments on commit 45dc9e5

Please sign in to comment.