Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user setting: blur posters of unwatched episodes #665

Merged
merged 2 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion components/ListPoster.brs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,18 @@ sub itemContentChanged() as void
end if
m.staticTitle.text = m.title.text

m.poster.uri = itemData.posterUrl
imageUrl = itemData.posterURL

if get_user_setting("ui.tvshows.blurunwatched") = "true"

if itemData.json.lookup("Type") = "Episode"
if not itemData.json.userdata.played
imageUrl = imageUrl + "&blur=15"
end if
end if
end if

m.poster.uri = imageUrl

updateSize()
end sub
Expand Down
2 changes: 1 addition & 1 deletion components/ListPoster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
</interface>

<script type="text/brightscript" uri="ListPoster.brs" />

<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>
14 changes: 13 additions & 1 deletion components/tvshows/TVListDetails.brs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sub init()
m.title.text = tr("Loading...")
m.options = m.top.findNode("tvListOptions")
m.overview = m.top.findNode("overview")
m.poster = m.top.findNode("poster")
m.deviceInfo = CreateObject("roDeviceInfo")
end sub

Expand All @@ -15,9 +16,20 @@ sub itemContentChanged()
indexNumber = ""
end if
m.title.text = indexNumber + item.title
m.top.findNode("poster").uri = item.posterURL
m.overview.text = item.overview

imageUrl = item.posterURL

if get_user_setting("ui.tvshows.blurunwatched") = "true"
if itemData.lookup("Type") = "Episode"
if not itemData.userdata.played
imageUrl = imageUrl + "&blur=15"
end if
end if
end if

m.poster.uri = imageUrl

if type(itemData.RunTimeTicks) = "LongInteger"
m.top.findNode("runtime").text = stri(getRuntime()).trim() + " mins"
m.top.findNode("endtime").text = tr("Ends at %1").Replace("%1", getEndTime())
Expand Down
1 change: 1 addition & 0 deletions components/tvshows/TVListDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
</interface>
<script type="text/brightscript" uri="TVListDetails.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>
18 changes: 18 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,24 @@
<translation>Use the replay button to slowly animate to the first item in the folder. (If disabled, The folder will reset to the first item immediately)</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>TV Shows</source>
<translation>TV Shows</translation>
</message>
<message>
<source>Options for TV Shows.</source>
<translation>Options for TV Shows.</translation>
<extracomment>Description for TV Shows user settings.</extracomment>
</message>
<message>
<source>Blur Unwatched Episodes</source>
<translation>Blur Unwatched Episodes</translation>
<extracomment>Option Title in user setting screen</extracomment>
</message>
<message>
<source>If enabled, images for unwatched episodes will be blurred.</source>
<translation>If enabled, images for unwatched episodes will be blurred.</translation>
</message>
<message>
<source>Screensaver</source>
<translation>Screensaver</translation>
Expand Down
13 changes: 13 additions & 0 deletions settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"description": "Settings relating to how the how the application looks",
"children": [
{
"title": "TV Shows",
"description": "Options for TV Shows.",
"children": [
{
"title": "Blur Unwatched Episodes",
"description": "If enabled, images for unwatched episodes will be blurred.",
"settingName": "ui.tvshows.blurunwatched",
"type": "bool",
"default": "false"
}
]
},
{
"title": "Screensaver",
"description": "Options for Jellyfin's screensaver.",
"children": [
Expand Down