diff --git a/components/home/HomeItem.bs b/components/home/HomeItem.bs index 1048980f0..301c5a981 100644 --- a/components/home/HomeItem.bs +++ b/components/home/HomeItem.bs @@ -39,6 +39,7 @@ sub itemContentChanged() m.unplayedCount.visible = false itemData = m.top.itemContent if itemData = invalid then return + localGlobal = m.global itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem" @@ -61,11 +62,13 @@ sub itemContentChanged() m.playedIndicator.visible = false if LCase(itemData.type) = "series" - if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false - if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount) - if itemData.json.UserData.UnplayedItemCount > 0 - m.unplayedCount.visible = true - m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount + if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings) + if localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false + if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount) + if itemData.json.UserData.UnplayedItemCount > 0 + m.unplayedCount.visible = true + m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount + end if end if end if end if