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/**/*.*", "locale/**/*.*",
"settings/*.*" "settings/*.*"
], ],
"plugins": [ "@rokucommunity/bslint" ], "plugins": [
"@rokucommunity/bslint"
],
"diagnosticFilters": [ "diagnosticFilters": [
"**/roku_modules/**/*" "**/roku_modules/**/*",
"**/testFramework/*",
"**/tests/*"
] ]
} }

View File

@ -13,11 +13,11 @@ sub init()
m.itemText.translation = [0, m.itemPoster.height + 7] m.itemText.translation = [0, m.itemPoster.height + 7]
m.alwaysShowTitles = get_user_setting("itemgrid.alwaysShowTitles") = "true" m.gridTitles = get_user_setting("itemgrid.gridTitles")
m.itemText.visible = m.alwaysShowTitles m.itemText.visible = m.gridTitles = "showalways"
' Add some padding space when Item Titles are always showing ' 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 'Parent is MarkupGrid and it's parent is the ItemGrid
m.topParent = m.top.GetParent().GetParent() m.topParent = m.top.GetParent().GetParent()
@ -131,16 +131,17 @@ end sub
'Display or hide title Visibility on focus change 'Display or hide title Visibility on focus change
sub focusChanged() sub focusChanged()
if m.top.itemHasFocus = true if m.top.itemHasFocus = true
m.itemText.visible = true
m.itemText.repeatCount = -1 m.itemText.repeatCount = -1
m.posterMask.scale = [1, 1] m.posterMask.scale = [1, 1]
else else
m.itemText.visible = m.alwaysShowTitles
m.itemText.repeatCount = 0 m.itemText.repeatCount = 0
if m.topParent.alphaActive = true if m.topParent.alphaActive = true
m.posterMask.scale = [0.85, 0.85] m.posterMask.scale = [0.85, 0.85]
end if end if
end if end if
if m.gridTitles = "showonhover"
m.itemText.visible = m.top.itemHasFocus
end if
end sub end sub
'Hide backdrop and text when poster loaded 'Hide backdrop and text when poster loaded

View File

@ -196,7 +196,7 @@ sub loadInitialItems()
m.itemGrid.numRows = "3" m.itemGrid.numRows = "3"
m.selectedMovieOverview.visible = false m.selectedMovieOverview.visible = false
m.infoGroup.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" if LCase(m.top.showItemTitles) = "hidealways"
m.itemGrid.itemSize = "[230, 315]" m.itemGrid.itemSize = "[230, 315]"
m.itemGrid.rowHeights = "[315]" m.itemGrid.rowHeights = "[315]"

View File

@ -1,5 +1,6 @@
sub init() sub init()
m.itemPoster = m.top.findNode("itemPoster") m.itemPoster = m.top.findNode("itemPoster")
m.postTextBackground = m.top.findNode("postTextBackground")
m.posterText = m.top.findNode("posterText") m.posterText = m.top.findNode("posterText")
m.posterText.font.size = 30 m.posterText.font.size = 30
m.backdrop = m.top.findNode("backdrop") m.backdrop = m.top.findNode("backdrop")
@ -14,11 +15,25 @@ sub init()
m.itemPoster.loadDisplayMode = m.topParent.imageDisplayMode m.itemPoster.loadDisplayMode = m.topParent.imageDisplayMode
end if end if
m.gridTitles = get_user_setting("itemgrid.gridTitles")
m.posterText.visible = false
m.postTextBackground.visible = false
end sub end sub
sub itemContentChanged() sub itemContentChanged()
m.backdrop.blendColor = "#101010" 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 itemData = m.top.itemContent
if not isValid(itemData) then return if not isValid(itemData) then return
@ -38,6 +53,23 @@ sub itemContentChanged()
if m.itemPoster.loadStatus <> "ready" if m.itemPoster.loadStatus <> "ready"
m.backdrop.visible = true m.backdrop.visible = true
end if 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 end sub
'Hide backdrop and text when poster loaded 'Hide backdrop and text when poster loaded

View File

@ -135,6 +135,8 @@ sub loadInitialItems()
m.sortAscending = false m.sortAscending = false
end if end if
m.top.showItemTitles = get_user_setting("itemgrid.gridTitles")
if LCase(m.top.parentItem.json.type) = "musicgenre" if LCase(m.top.parentItem.json.type) = "musicgenre"
m.itemGrid.translation = "[96, 60]" m.itemGrid.translation = "[96, 60]"
m.loadItemsTask.itemType = "MusicAlbum" m.loadItemsTask.itemType = "MusicAlbum"
@ -143,6 +145,7 @@ sub loadInitialItems()
m.loadItemsTask.itemId = m.top.parentItem.parentFolder m.loadItemsTask.itemId = m.top.parentItem.parentFolder
else if LCase(m.view) = "artistspresentation" or LCase(m.options.view) = "artistspresentation" else if LCase(m.view) = "artistspresentation" or LCase(m.options.view) = "artistspresentation"
m.loadItemsTask.genreIds = "" m.loadItemsTask.genreIds = ""
m.top.showItemTitles = "hidealways"
else if LCase(m.view) = "artistsgrid" or LCase(m.options.view) = "artistsgrid" else if LCase(m.view) = "artistsgrid" or LCase(m.options.view) = "artistsgrid"
m.loadItemsTask.genreIds = "" m.loadItemsTask.genreIds = ""
else else

View File

@ -33,13 +33,13 @@
</children> </children>
<interface> <interface>
<field id="HomeLibraryItem" type="string"/> <field id="HomeLibraryItem" type="string"/>
<field id="View" type="string"/>
<field id="parentItem" type="node" onChange="loadInitialItems" /> <field id="parentItem" type="node" onChange="loadInitialItems" />
<field id="selectedItem" type="node" alwaysNotify="true" /> <field id="selectedItem" type="node" alwaysNotify="true" />
<field id="quickPlayNode" type="node" alwaysNotify="true" /> <field id="quickPlayNode" type="node" alwaysNotify="true" />
<field id="imageDisplayMode" type="string" value="scaleToZoom" /> <field id="imageDisplayMode" type="string" value="scaleToZoom" />
<field id="AlphaSelected" type="string" alias="AlphaMenu.itemAlphaSelected" alwaysNotify="true" onChange="onItemAlphaSelected" /> <field id="AlphaSelected" type="string" alias="AlphaMenu.itemAlphaSelected" alwaysNotify="true" onChange="onItemAlphaSelected" />
<field id="alphaActive" type="boolean" value="false" /> <field id="alphaActive" type="boolean" value="false" />
<field id="showItemTitles" type="string" value="showonhover" />
<field id="jumpToItem" type="integer" value="" /> <field id="jumpToItem" type="integer" value="" />
</interface> </interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" /> <script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />

View File

@ -557,16 +557,6 @@
<source>Media Grid options.</source> <source>Media Grid options.</source>
<translation>Media Grid options.</translation> <translation>Media Grid options.</translation>
</message> </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> <message>
<source>Item Count</source> <source>Item Count</source>
<translation>Item Count</translation> <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> <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> <extracomment>Description for option in Setting Screen</extracomment>
</message> </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> <message>
<source>Hide Taglines</source> <source>Hide Taglines</source>
<translation>Hide Taglines</translation> <translation>Hide Taglines</translation>
@ -712,8 +693,8 @@
<extracomment>Description for Screensaver user settings.</extracomment> <extracomment>Description for Screensaver user settings.</extracomment>
</message> </message>
<message> <message>
<source>Use Splashscreen as Screensaver Background</source> <source>Use Splashscreen as Screensaver</source>
<translation>Use Splashscreen as Screensaver Background</translation> <translation>Use Splashscreen as Screensaver</translation>
<extracomment>Option Title in user setting screen</extracomment> <extracomment>Option Title in user setting screen</extracomment>
</message> </message>
<message> <message>
@ -795,15 +776,6 @@
<source>Settings relating to how the application looks.</source> <source>Settings relating to how the application looks.</source>
<translation>Settings relating to how the application looks.</translation> <translation>Settings relating to how the application looks.</translation>
</message> </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> <message>
<source>Max Days Next Up</source> <source>Max Days Next Up</source>
<translation>Max Days Next Up</translation> <translation>Max Days Next Up</translation>
@ -992,9 +964,9 @@
<translation>Movies (Grid)</translation> <translation>Movies (Grid)</translation>
</message> </message>
<message> <message>
<source>Movie Library Grid Titles</source> <source>Item Titles</source>
<translation>Movie Library Grid Titles</translation> <translation>Item Titles</translation>
<extracomment>Settings Menu - Title for option</extracomment> <extracomment>Title of a setting - when should we show the title text of a grid item</extracomment>
</message> </message>
<message> <message>
<source>Select when to show titles.</source> <source>Select when to show titles.</source>
@ -1060,6 +1032,46 @@
<message> <message>
<source>Loading Movie Options</source> <source>Loading Movie Options</source>
<translation>Loading Movie Options</translation> <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> </message>
</context> </context>
</TS> </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", "title": "User Interface",
"description": "Settings relating to how the application looks.", "description": "Settings relating to how the application looks.",
"children": [ "children": [
{ {
"title": "Home Page", "title": "General",
"description": "Options for Home page.", "description": "Settings relating to the appearance of the Home screen and the program in general.",
"children": [ "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", "title": "Max Days Next Up",
"description": "Set the maximum amount of days a show should stay in the 'Next Up' list without watching it.", "description": "Set the maximum amount of days a show should stay in the 'Next Up' list without watching it.",
@ -88,61 +88,22 @@
"type": "integer", "type": "integer",
"default": "365" "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", "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.", "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", "settingName": "ui.home.splashBackground",
"type": "bool", "type": "bool",
"default": "false" "default": "false"
}
]
}, },
{ {
"title": "Details Page", "title": "Use Splashscreen as Screensaver",
"description": "Options for Details pages.",
"children": [
{
"title": "Hide Taglines",
"description": "Hides tagline text on details pages.",
"settingName": "ui.details.hidetagline",
"type": "bool",
"default": "false"
}
]
},
{
"title": "TV Shows",
"description": "Options for TV Shows.",
"children": [
{
"title": "Blur Unwatched Episodes",
"description": "If enabled, images of unwatched episodes will be blurred.",
"settingName": "ui.tvshows.blurunwatched",
"type": "bool",
"default": "false"
},
{
"title": "Skip Details for Single Seasons",
"description": "If enabled, selecting a TV series with only one season will go straight to the episode list rather than the show details and season list.",
"settingName": "ui.tvshows.goStraightToEpisodeListing",
"type": "bool",
"default": "false"
},
{
"title":"Disable Community Rating for Episodes",
"description": "If enabled, the star and community rating for episodes of a TV show will be removed. This is to prevent spoilers of an upcoming good/bad episode.",
"settingName": "ui.tvshows.disableCommunityRating",
"type":"bool",
"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.", "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", "settingName": "ui.screensaver.splashBackground",
"type": "bool", "type": "bool",
@ -151,43 +112,28 @@
] ]
}, },
{ {
"title": "Design Elements", "title": "Libraries",
"description": "Options that alter the design of Jellyfin.", "description": "Settings relating to the appearance of Library pages.",
"children": [ "children": [
{ {
"title": "Hide Clock", "title": "General",
"description": "Hides all clocks in Jellyfin. Jellyfin will need to be closed and reopened for change to take effect.", "description": "Settings relating to the appearance of pages in all Libraries.",
"settingName": "ui.design.hideclock", "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", "type": "bool",
"default": "false" "default": "false"
}
]
}, },
{ {
"title": "Media Grid", "title": "Item Titles",
"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.", "description": "Select when to show titles.",
"settingName": "itemgrid.movieGridTitles", "settingName": "itemgrid.gridTitles",
"type": "radio", "type": "radio",
"default": "showonhover", "default": "showonhover",
"options": [ "options": [
@ -204,18 +150,13 @@
"id": "hidealways" "id": "hidealways"
} }
] ]
}
]
}, },
{ {
"title": "Item Count", "title": "Hide Taglines",
"description": "Show item count in the library and index of selected item.", "description": "Hides tagline text on details pages.",
"settingName": "itemgrid.showItemCount", "settingName": "ui.details.hidetagline",
"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", "type": "bool",
"default": "false" "default": "false"
}, },
@ -227,6 +168,58 @@
"default": "true" "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": "Settings relating to the appearance of pages in TV Libraries.",
"children": [
{
"title": "Blur Unwatched Episodes",
"description": "If enabled, images of unwatched episodes will be blurred.",
"settingName": "ui.tvshows.blurunwatched",
"type": "bool",
"default": "false"
},
{
"title": "Skip Details for Single Seasons",
"description": "If enabled, selecting a TV series with only one season will go straight to the episode list rather than the show details and season list.",
"settingName": "ui.tvshows.goStraightToEpisodeListing",
"type": "bool",
"default": "false"
},
{
"title": "Disable Community Rating for Episodes",
"description": "If enabled, the star and community rating for episodes of a TV show will be removed. This is to prevent spoilers of an upcoming good/bad episode.",
"settingName": "ui.tvshows.disableCommunityRating",
"type": "bool",
"default": "false"
}
]
}
]
} }
] ]
} }

View File

@ -2,6 +2,22 @@ sub Main (args as dynamic) as void
appInfo = CreateObject("roAppInfo") 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. ' The main function that runs when the application is launched.
m.screen = CreateObject("roSGScreen") 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