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

View File

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

View File

@ -38,10 +38,12 @@ sub itemContentChanged()
end if end if
if LCase(itemData.type) = "series" if LCase(itemData.type) = "series"
if itemData?.json?.UserData?.UnplayedItemCount <> invalid if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if itemData.json.UserData.UnplayedItemCount > 0 if itemData?.json?.UserData?.UnplayedItemCount <> invalid
m.unplayedCount.visible = true if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if end if
end if end if
end if end if

View File

@ -17,10 +17,12 @@ sub setSeasonLoading()
end sub end sub
sub updateSeason() sub updateSeason()
if m.top.seasonData?.UserData?.UnplayedItemCount <> invalid if get_user_setting("ui.tvshows.disableUnwatchedEpisodeCount", "false") = "false"
if m.top.seasonData.UserData.UnplayedItemCount > 0 if m.top.seasonData?.UserData?.UnplayedItemCount <> invalid
m.unplayedCount.visible = true if m.top.seasonData.UserData.UnplayedItemCount > 0
m.unplayedEpisodeCount.text = m.top.seasonData.UserData.UnplayedItemCount m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = m.top.seasonData.UserData.UnplayedItemCount
end if
end if end if
end if end if

View File

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

View File

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

View File

@ -1087,5 +1087,16 @@
<translation>Grid</translation> <translation>Grid</translation>
<extracomment>Title of an option - name of grid view</extracomment> <extracomment>Title of an option - name of grid view</extracomment>
</message> </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> </context>
</TS> </TS>

View File

@ -224,16 +224,23 @@
"default": "false" "default": "false"
}, },
{ {
"title": "Skip Details for Single Seasons", "title": "Disable Community Rating for Episodes",
"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.", "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.goStraightToEpisodeListing", "settingName": "ui.tvshows.disableCommunityRating",
"type": "bool", "type": "bool",
"default": "false" "default": "false"
}, },
{ {
"title": "Disable Community Rating for Episodes", "title": "Disable Unwatched Episode Count",
"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.", "description": "If enabled, the number of unwatched episodes in a series/season will be removed.",
"settingName": "ui.tvshows.disableCommunityRating", "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", "type": "bool",
"default": "false" "default": "false"
} }