Merge pull request #1018 from 1hitsong/disableUnwatchedCount

New User Setting: Disable Unwatched Episode Count
This commit is contained in:
1hitsong 2023-02-04 20:29:14 -05:00 committed by GitHub
commit ce7d74493c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 26 deletions

View File

@ -43,12 +43,14 @@ sub itemContentChanged()
m.itemIcon.uri = itemData.iconUrl
m.itemText.text = itemData.Title
else if itemData.type = "Series"
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if
m.itemPoster.uri = itemData.PosterUrl
m.itemIcon.uri = itemData.iconUrl

View File

@ -57,12 +57,14 @@ sub itemContentChanged() as void
itemData = m.top.itemContent
m.title.text = itemData.title
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if
if itemData.json.lookup("Type") = "Episode" and itemData.json.IndexNumber <> invalid
m.title.text = StrI(itemData.json.IndexNumber) + ". " + m.title.text

View File

@ -38,6 +38,7 @@ sub itemContentChanged()
end if
if LCase(itemData.type) = "series"
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
@ -45,6 +46,7 @@ sub itemContentChanged()
end if
end if
end if
end if
' Format the Data based on the type of Home Data
if itemData.type = "CollectionFolder" or itemData.type = "UserView" or itemData.type = "Channel"

View File

@ -17,12 +17,14 @@ sub setSeasonLoading()
end sub
sub updateSeason()
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if m.top.seasonData?.UserData?.UnplayedItemCount <> invalid
if m.top.seasonData.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = m.top.seasonData.UserData.UnplayedItemCount
end if
end if
end if
imgParams = { "maxHeight": 450, "maxWidth": 300 }
m.poster.uri = ImageURL(m.top.seasonData.Id, "Primary", imgParams)

View File

@ -15,12 +15,14 @@ sub itemContentChanged()
item = m.top.itemContent
itemData = item.json
if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData?.UserData?.UnplayedItemCount <> invalid
if itemData.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.UserData.UnplayedItemCount
end if
end if
end if
m.top.findNode("tvshowPoster").uri = m.top.itemContent.posterURL

View File

@ -33,5 +33,6 @@
<field id="seasonSelected" alias="seasons.rowItemSelected" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="TVShowDetails.brs" />
</component>

View File

@ -1087,5 +1087,16 @@
<translation>Grid</translation>
<extracomment>Title of an option - name of grid view</extracomment>
</message>
<message>
<source>Disable Unwatched Episode Count</source>
<translation>Disable Unwatched Episode Count</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>If enabled, the number of unwatched episodes in a series/season will be removed.</source>
<translation>If enabled, the number of unwatched episodes in a series/season will be removed.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
</context>
</TS>

View File

@ -224,16 +224,23 @@
"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",
"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": "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",
"title": "Disable Unwatched Episode Count",
"description": "If enabled, the number of unwatched episodes in a series/season will be removed.",
"settingName": "ui.tvshows.disableUnwatchedEpisodeCount",
"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"
}