Skip to content

Commit

Permalink
Merge branch 'master' into fixes/flickering-items
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdogx authored May 23, 2022
2 parents 23acaac + ba773a8 commit 6b3dbdf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
22 changes: 17 additions & 5 deletions components/ItemGrid/ItemGrid.brs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ sub init()

m.options = m.top.findNode("options")

m.showItemCount = get_user_setting("itemgrid.showItemCount") = "true"

m.tvGuide = invalid
m.channelFocused = invalid

Expand Down Expand Up @@ -37,6 +39,9 @@ sub init()
m.favorite = "Favorite"

m.loadItemsTask = createObject("roSGNode", "LoadItemsTask2")

'set inital counts for overhang before content is loaded.
m.loadItemsTask.totalRecordCount = 0
m.spinner = m.top.findNode("spinner")
m.spinner.visible = true

Expand Down Expand Up @@ -299,6 +304,9 @@ sub onItemFocused()
focusedRow = m.itemGrid.currFocusRow

itemInt = m.itemGrid.itemFocused

updateTitle()

' If no selected item, set background to parent backdrop
if itemInt = -1
return
Expand Down Expand Up @@ -428,7 +436,6 @@ sub optionsClosed()
m.filter = m.options.filter
updateTitle()
reload = true

'Store filter setting
if m.top.parentItem.collectionType = "livetv"
set_user_setting("display.livetv.filter", m.options.filter)
Expand Down Expand Up @@ -537,11 +544,16 @@ sub updateTitle()
if m.filter = "All"
m.top.overhangTitle = m.top.parentItem.title
else if m.filter = "Favorites"
m.top.overhangTitle = m.top.parentItem.title + tr(" (Favorites)")
else
m.top.overhangTitle = m.top.parentItem.title + tr(" (Filtered)")
m.top.overhangTitle = m.top.parentItem.title + " " + tr("(Favorites)")
end if

if m.top.AlphaSelected <> ""
m.top.overhangTitle = m.top.parentItem.title + tr(" (Filtered)")
m.top.overhangTitle = m.top.parentItem.title + " " + tr("(Filtered)")
end if

actInt = m.itemGrid.itemFocused + 1
if m.showItemCount and m.loadItemsTask.totalRecordCount > 0
m.top.overhangTitle += " (" + tr("%1 of %2").Replace("%1", actInt.toStr()).Replace("%2", m.loadItemsTask.totalRecordCount.toStr()) + ")"
end if

end sub
4 changes: 4 additions & 0 deletions components/ItemGrid/LoadItemsTask2.brs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ sub loadItems()
tmp = CreateObject("roSGNode", "FolderData")
else if item.Type = "Video"
tmp = CreateObject("roSGNode", "VideoData")
else if item.Type = "Photo"
tmp = CreateObject("roSGNode", "PhotoData")
else if item.type = "PhotoAlbum"
tmp = CreateObject("roSGNode", "FolderData")
else
print "[LoadItems] Unknown Type: " item.Type
end if
Expand Down
15 changes: 15 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
<translation>Always show the titles below the poster images. (If disabled, title will be shown under hilighted item only)</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>Item Count</source>
<translation>Item Count</translation>
<extracomment>UI -> Media Grid -> Item Count in user setting screen.</extracomment>
</message>
<message>
<source>Show item count in the library, and index of selected item.</source>
<translation>Show item count in the library, and index of selected item.</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>Set Favorite</source>
<translation>Set Favorite</translation>
Expand All @@ -542,5 +552,10 @@
<translation>Go to episode</translation>
<extracomment>Continue Watching Popup Menu - Navigate to the Episode Detail Page</extracomment>
</message>
<message>
<source>%1 of %2</source>
<translation>%1 of %2</translation>
<extracomment>Item position and count. %1 = current item. %2 = total number of items</extracomment>
</message>
</context>
</TS>
7 changes: 7 additions & 0 deletions settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"title": "Media Grid",
"description": "Media Grid Options",
"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": "Always show the titles below the poster images. (If disabled, title will be shown under hilighted item only)",
Expand Down

0 comments on commit 6b3dbdf

Please sign in to comment.