diff --git a/components/ItemGrid/ItemGrid.brs b/components/ItemGrid/ItemGrid.brs index 5eabee9aa..2c8d0f51a 100644 --- a/components/ItemGrid/ItemGrid.brs +++ b/components/ItemGrid/ItemGrid.brs @@ -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 @@ -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 @@ -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 @@ -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) @@ -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 diff --git a/components/ItemGrid/LoadItemsTask2.brs b/components/ItemGrid/LoadItemsTask2.brs index 97b2973dd..56da7fa7d 100644 --- a/components/ItemGrid/LoadItemsTask2.brs +++ b/components/ItemGrid/LoadItemsTask2.brs @@ -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 diff --git a/locale/en_US/translations.ts b/locale/en_US/translations.ts index a0f8bcb0e..03236a39c 100644 --- a/locale/en_US/translations.ts +++ b/locale/en_US/translations.ts @@ -517,6 +517,16 @@ Always show the titles below the poster images. (If disabled, title will be shown under hilighted item only) Description for option in Setting Screen + + Item Count + Item Count + UI -> Media Grid -> Item Count in user setting screen. + + + Show item count in the library, and index of selected item. + Show item count in the library, and index of selected item. + Description for option in Setting Screen + Set Favorite Set Favorite @@ -542,5 +552,10 @@ Go to episode Continue Watching Popup Menu - Navigate to the Episode Detail Page + + %1 of %2 + %1 of %2 + Item position and count. %1 = current item. %2 = total number of items + diff --git a/settings/settings.json b/settings/settings.json index 6130a0272..1c46247cf 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -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)",