Merge branch 'unstable' into Add-Loading-ux-to-movies-details-screen

This commit is contained in:
candry7731 2023-02-02 13:42:19 -06:00 committed by GitHub
commit 827a5fd406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 3167 additions and 158 deletions

View File

@ -8,8 +8,12 @@
"locale/**/*.*",
"settings/*.*"
],
"plugins": [ "@rokucommunity/bslint" ],
"plugins": [
"@rokucommunity/bslint"
],
"diagnosticFilters": [
"**/roku_modules/**/*"
"**/roku_modules/**/*",
"**/testFramework/*",
"**/tests/*"
]
}

View File

@ -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()
@ -131,16 +131,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

View File

@ -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]"

View File

@ -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")
@ -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
@ -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

View File

@ -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"
@ -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

View File

@ -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" />

View File

@ -557,16 +557,6 @@
<source>Media Grid options.</source>
<translation>Media Grid options.</translation>
</message>
<message>
<source>Item Titles</source>
<translation>Item Titles</translation>
<extracomment>UI -&gt; Media Grid -&gt; Item Title in user setting screen.</extracomment>
</message>
<message>
<source>Always show the titles below the poster images. (If disabled, the title will be shown under the highlighted item only).</source>
<translation>Always show the titles below the poster images. (If disabled, the title will be shown under the highlighted item only).</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>Item Count</source>
<translation>Item Count</translation>
@ -660,15 +650,6 @@
<translation>Use the replay button to slowly animate to the first item in the folder. (If disabled, the folder will reset to the first item immediately).</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>Details Page</source>
<translation>Details Page</translation>
</message>
<message>
<source>Options for Details pages.</source>
<translation>Options for Details pages.</translation>
<extracomment>Description for Details page user settings.</extracomment>
</message>
<message>
<source>Hide Taglines</source>
<translation>Hide Taglines</translation>
@ -712,8 +693,8 @@
<extracomment>Description for Screensaver user settings.</extracomment>
</message>
<message>
<source>Use Splashscreen as Screensaver Background</source>
<translation>Use Splashscreen as Screensaver Background</translation>
<source>Use Splashscreen as Screensaver</source>
<translation>Use Splashscreen as Screensaver</translation>
<extracomment>Option Title in user setting screen</extracomment>
</message>
<message>
@ -795,15 +776,6 @@
<source>Settings relating to how the application looks.</source>
<translation>Settings relating to how the application looks.</translation>
</message>
<message>
<source>Home Page</source>
<translation>Home Page</translation>
</message>
<message>
<source>Options for Home Page.</source>
<translation>Options for Home Page.</translation>
<extracomment>Description for Home Page user settings.</extracomment>
</message>
<message>
<source>Max Days Next Up</source>
<translation>Max Days Next Up</translation>
@ -992,9 +964,9 @@
<translation>Movies (Grid)</translation>
</message>
<message>
<source>Movie Library Grid Titles</source>
<translation>Movie Library Grid Titles</translation>
<extracomment>Settings Menu - Title for option</extracomment>
<source>Item Titles</source>
<translation>Item Titles</translation>
<extracomment>Title of a setting - when should we show the title text of a grid item</extracomment>
</message>
<message>
<source>Select when to show titles.</source>
@ -1060,6 +1032,46 @@
<message>
<source>Loading Movie Options</source>
<translation>Loading Movie Options</translation>
<source>Libraries</source>
<translation>Libraries</translation>
</message>
<message>
<source>Settings relating to the appearance of Library pages</source>
<translation>Settings relating to the appearance of Library pages</translation>
</message>
<message>
<source>General</source>
<translation>General</translation>
</message>
<message>
<source>Settings relating to the appearance of the Home screen and the program in general.</source>
<translation>Settings relating to the appearance of the Home screen and the program in general.</translation>
</message>
<message>
<source>Grid View Settings</source>
<translation>Grid View Settings</translation>
</message>
<message>
<source>Settings that apply when Grid views are enabled.</source>
<translation>Settings that apply when Grid views are enabled.</translation>
</message>
<message>
<source>Settings relating to the appearance of pages in TV Libraries.</source>
<translation>Settings relating to the appearance of pages in TV Libraries.</translation>
</message>
<message>
<source>Settings relating to the appearance of pages in Movie Libraries.</source>
<translation>Settings relating to the appearance of pages in Movie Libraries.</translation>
</message>
<message>
<source>Presentation</source>
<translation>Presentation</translation>
<extracomment>Title of an option - name of presentation view</extracomment>
</message>
<message>
<source>Grid</source>
<translation>Grid</translation>
<extracomment>Title of an option - name of grid view</extracomment>
</message>
</context>
</TS>

View File

@ -66,21 +66,21 @@
}
]
},
{
"title": "Show What's New Popup",
"description": "Show What's New popup when Jellyfin is updated to a new version.",
"settingName": "load.allowwhatsnew",
"type": "bool",
"default": "true"
},
{
"title": "User Interface",
"description": "Settings relating to how the application looks.",
"children": [
{
"title": "Home Page",
"description": "Options for Home page.",
"title": "General",
"description": "Settings relating to the appearance of the Home screen and the program in general.",
"children": [
{
"title": "Hide Clock",
"description": "Hides all clocks in Jellyfin. Jellyfin will need to be closed and reopened for change to take effect.",
"settingName": "ui.design.hideclock",
"type": "bool",
"default": "false"
},
{
"title": "Max Days Next Up",
"description": "Set the maximum amount of days a show should stay in the 'Next Up' list without watching it.",
@ -88,31 +88,113 @@
"type": "integer",
"default": "365"
},
{
"title": "Show What's New Popup",
"description": "Show What's New popup when Jellyfin is updated to a new version.",
"settingName": "load.allowwhatsnew",
"type": "bool",
"default": "true"
},
{
"title": "Use Splashscreen as Home Background",
"description": "Use generated splashscreen image as Jellyfin's home background. Jellyfin will need to be closed and reopened for change to take effect.",
"settingName": "ui.home.splashBackground",
"type": "bool",
"default": "false"
},
{
"title": "Use Splashscreen as Screensaver",
"description": "Use generated splashscreen image as Jellyfin's screensaver background. Jellyfin will need to be closed and reopened for change to take effect.",
"settingName": "ui.screensaver.splashBackground",
"type": "bool",
"default": "false"
}
]
},
{
"title": "Details Page",
"description": "Options for Details pages.",
"title": "Libraries",
"description": "Settings relating to the appearance of Library pages.",
"children": [
{
"title": "General",
"description": "Settings relating to the appearance of pages in all Libraries.",
"children": [
{
"title": "Grid View Settings",
"description": "Settings that apply when Grid views are enabled.",
"children": [
{
"title": "Item Count",
"description": "Show item count in the library and index of selected item.",
"settingName": "itemgrid.showItemCount",
"type": "bool",
"default": "false"
},
{
"title": "Item Titles",
"description": "Select when to show titles.",
"settingName": "itemgrid.gridTitles",
"type": "radio",
"default": "showonhover",
"options": [
{
"title": "Show On Hover",
"id": "showonhover"
},
{
"title": "Always Show",
"id": "showalways"
},
{
"title": "Always Hide",
"id": "hidealways"
}
]
}
]
},
{
"title": "Hide Taglines",
"description": "Hides tagline text on details pages.",
"settingName": "ui.details.hidetagline",
"type": "bool",
"default": "false"
},
{
"title": "Return to Top",
"description": "Use the replay button to slowly animate to the first item in the folder. (If disabled, the folder will reset to the first item immediately).",
"settingName": "itemgrid.reset",
"type": "bool",
"default": "true"
}
]
},
{
"title": "Movies",
"description": "Settings relating to the appearance of pages in Movie Libraries.",
"children": [
{
"title": "Default View",
"description": "Default view for Movie Libraries.",
"settingName": "itemgrid.movieDefaultView",
"type": "radio",
"default": "movies",
"options": [
{
"title": "Movies (Presentation)",
"id": "Movies"
},
{
"title": "Movies (Grid)",
"id": "MoviesGrid"
}
]
}
]
},
{
"title": "TV Shows",
"description": "Options for TV Shows.",
"description": "Settings relating to the appearance of pages in TV Libraries.",
"children": [
{
"title": "Blur Unwatched Episodes",
@ -136,95 +218,6 @@
"default": "false"
}
]
},
{
"title": "Screensaver",
"description": "Options for Jellyfin's screensaver.",
"children": [
{
"title": "Use Splashscreen as Screensaver Background",
"description": "Use generated splashscreen image as Jellyfin's screensaver background. Jellyfin will need to be closed and reopened for change to take effect.",
"settingName": "ui.screensaver.splashBackground",
"type": "bool",
"default": "false"
}
]
},
{
"title": "Design Elements",
"description": "Options that alter the design of Jellyfin.",
"children": [
{
"title": "Hide Clock",
"description": "Hides all clocks in Jellyfin. Jellyfin will need to be closed and reopened for change to take effect.",
"settingName": "ui.design.hideclock",
"type": "bool",
"default": "false"
}
]
},
{
"title": "Media Grid",
"description": "Media Grid options.",
"children": [
{
"title": "Movie Library Default View",
"description": "Default view for Movie Libraries.",
"settingName": "itemgrid.movieDefaultView",
"type": "radio",
"default": "movies",
"options": [
{
"title": "Movies (Presentation)",
"id": "Movies"
},
{
"title": "Movies (Grid)",
"id": "MoviesGrid"
}
]
},
{
"title": "Movie Library Grid Titles",
"description": "Select when to show titles.",
"settingName": "itemgrid.movieGridTitles",
"type": "radio",
"default": "showonhover",
"options": [
{
"title": "Show On Hover",
"id": "showonhover"
},
{
"title": "Always Show",
"id": "showalways"
},
{
"title": "Always Hide",
"id": "hidealways"
}
]
},
{
"title": "Item Count",
"description": "Show item count in the library and index of selected item.",
"settingName": "itemgrid.showItemCount",
"type": "bool",
"default": "false"
},
{
"title": "Item Titles",
"description": "Always show the titles below the poster images. (If disabled, the title will be shown under the highlighted item only).",
"settingName": "itemgrid.alwaysShowTitles",
"type": "bool",
"default": "false"
},
{
"title": "Return to Top",
"description": "Use the replay button to slowly animate to the first item in the folder. (If disabled, the folder will reset to the first item immediately).",
"settingName": "itemgrid.reset",
"type": "bool",
"default": "true"
}
]
}

View File

@ -2,6 +2,22 @@ sub Main (args as dynamic) as void
appInfo = CreateObject("roAppInfo")
if appInfo.IsDev() and args.RunTests = "true" and TF_Utils__IsFunction(TestRunner)
' POST to {ROKU ADDRESS}:8060/launch/dev?RunTests=true
Runner = TestRunner()
Runner.SetFunctions([
TestSuite__Misc
])
Runner.Logger.SetVerbosity(1)
Runner.Logger.SetEcho(false)
Runner.Logger.SetJUnit(false)
Runner.SetFailFast(true)
Runner.Run()
end if
' The main function that runs when the application is launched.
m.screen = CreateObject("roSGScreen")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
function TestSuite__Misc() as object
' Inherite test suite from BaseTestSuite
this = BaseTestSuite()
' Test suite name for log statistics
this.Name = "MiscTestSuite"
this.SetUp = MiscTestSuite__SetUp
this.TearDown = MiscTestSuite__TearDown
' Add tests to suite's tests collection
this.addTest("IsValid() true", TestCase__Misc_IsValid_True)
this.addTest("IsValid() false", TestCase__Misc_IsValid_False)
this.addTest("RoundNumber() Floor", TestCase__Misc_RoundNumber_Floor)
this.addTest("RoundNumber() Ceiling", TestCase__Misc_RoundNumber_Ceiling)
return this
end function
'----------------------------------------------------------------
' This function called immediately before running tests of current suite.
'----------------------------------------------------------------
sub MiscTestSuite__SetUp()
end sub
'----------------------------------------------------------------
' This function called immediately after running tests of current suite.
'----------------------------------------------------------------
sub MiscTestSuite__TearDown()
end sub
'----------------------------------------------------------------
' Check if isValid() properly identifies valid items
'
' @return An empty string if test is success or error message if not.
'----------------------------------------------------------------
function TestCase__Misc_IsValid_True() as string
returnResults = ""
testData = [1, 2, [3, 4], { "key": invalid }, [1, 2, 3], CreateObject("roAppInfo")]
for each testItem in testData
returnResults = returnResults + m.AssertTrue(isValid(testItem))
end for
return m.AssertEmpty(returnResults)
end function
'----------------------------------------------------------------
' Check if isValid() properly identifies invalid items
'
' @return An empty string if test is success or error message if not.
'----------------------------------------------------------------
function TestCase__Misc_IsValid_False() as string
returnResults = ""
testData = [invalid, CreateObject("nothing")]
for each testItem in testData
returnResults = m.AssertFalse(isValid(testItem))
end for
return m.AssertEmpty(returnResults)
end function
'----------------------------------------------------------------
' Check if roundNumber() properly rounds down
'
' @return An empty string if test is success or error message if not.
'----------------------------------------------------------------
function TestCase__Misc_RoundNumber_Floor() as string
return m.AssertEqual(roundNumber(9.4), 9)
end function
'----------------------------------------------------------------
' Check if roundNumber() properly rounds up
'
' @return An empty string if test is success or error message if not.
'----------------------------------------------------------------
function TestCase__Misc_RoundNumber_Ceiling() as string
return m.AssertEqual(roundNumber(9.6), 10)
end function