From 6b109273e7bb2a91e6e4ccae652d316977078d3c Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Sat, 24 Dec 2022 13:23:29 -0700 Subject: [PATCH 1/8] set poster loadDisplayMode="scaleToZoom" prevents distoring images in episode listing --- components/tvshows/TVListDetails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tvshows/TVListDetails.xml b/components/tvshows/TVListDetails.xml index 4cb79d61..a888e87d 100644 --- a/components/tvshows/TVListDetails.xml +++ b/components/tvshows/TVListDetails.xml @@ -3,7 +3,7 @@ - + From d39ec5c31ab2d7f55ded89033fc1a87c48d52540 Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Wed, 28 Dec 2022 13:13:03 -0700 Subject: [PATCH 2/8] add client-side progressBar and playedIndicator render these client side to ensure they fit in custom image size --- components/tvshows/TVListDetails.brs | 18 ++++++++++++++++++ components/tvshows/TVListDetails.xml | 9 +++++++-- source/api/Items.brs | 7 +------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index f886b23d..06a3768b 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -8,6 +8,9 @@ sub init() m.rating = m.top.findnode("rating") m.infoBar = m.top.findnode("infoBar") + m.progressBackground = m.top.findNode("progressBackground") + m.progressBar = m.top.findnode("progressBar") + m.playedIndicator = m.top.findNode("playedIndicator") end sub sub itemContentChanged() @@ -59,6 +62,21 @@ sub itemContentChanged() m.top.findNode("star").visible = false end if + ' Add checkmark in corner (if applicable) + if isValid(itemData?.UserData?.Played) and itemData.UserData.Played = true + m.playedIndicator.uri = m.global.constants.icons.check_white + m.playedIndicator.visible = true + end if + + ' Add progress bar on bottom (if applicable) + if isValid(itemData?.UserData?.PlayedPercentage) and itemData?.UserData?.PlayedPercentage > 0 + m.progressBackground.width = m.poster.width + m.progressBackground.visible = true + progressWidthInPixels = int(m.progressBackground.width / itemData.UserData.PlayedPercentage) + m.progressBar.width = progressWidthInPixels + m.progressBar.visible = true + end if + videoIdx = invalid audioIdx = invalid diff --git a/components/tvshows/TVListDetails.xml b/components/tvshows/TVListDetails.xml index a888e87d..80e40036 100644 --- a/components/tvshows/TVListDetails.xml +++ b/components/tvshows/TVListDetails.xml @@ -2,8 +2,13 @@ - - + + + + + + + diff --git a/source/api/Items.brs b/source/api/Items.brs index 4cdf4b8e..61a36e26 100644 --- a/source/api/Items.brs +++ b/source/api/Items.brs @@ -389,13 +389,8 @@ function TVEpisodes(show_id as string, season_id as string) data = getJson(resp) results = [] for each item in data.Items - imgParams = { "AddPlayedIndicator": item.UserData.Played, "maxWidth": 400, "maxheight": 250 } - if item.UserData.PlayedPercentage <> invalid - param = { "PercentPlayed": item.UserData.PlayedPercentage } - imgParams.Append(param) - end if tmp = CreateObject("roSGNode", "TVEpisodeData") - tmp.image = PosterImage(item.id, imgParams) + tmp.image = PosterImage(item.id) if tmp.image <> invalid tmp.image.posterDisplayMode = "scaleToZoom" end if From 7bf4d8e1ac58f4b2d0186ca03aa43c6081df29b1 Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Wed, 28 Dec 2022 13:25:10 -0700 Subject: [PATCH 3/8] fix progress bar pixel calculation --- components/tvshows/TVListDetails.brs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index 06a3768b..efa7527b 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -72,7 +72,7 @@ sub itemContentChanged() if isValid(itemData?.UserData?.PlayedPercentage) and itemData?.UserData?.PlayedPercentage > 0 m.progressBackground.width = m.poster.width m.progressBackground.visible = true - progressWidthInPixels = int(m.progressBackground.width / itemData.UserData.PlayedPercentage) + progressWidthInPixels = int(m.progressBackground.width * itemData.UserData.PlayedPercentage / 100) m.progressBar.width = progressWidthInPixels m.progressBar.visible = true end if From 50f20685aae589c7cfadb84bb0c156b8abf200ab Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Wed, 28 Dec 2022 15:26:50 -0700 Subject: [PATCH 4/8] use rectangle and label for playback indicator --- components/tvshows/TVListDetails.brs | 1 - components/tvshows/TVListDetails.xml | 13 +++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index efa7527b..7cdba1f5 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -64,7 +64,6 @@ sub itemContentChanged() ' Add checkmark in corner (if applicable) if isValid(itemData?.UserData?.Played) and itemData.UserData.Played = true - m.playedIndicator.uri = m.global.constants.icons.check_white m.playedIndicator.visible = true end if diff --git a/components/tvshows/TVListDetails.xml b/components/tvshows/TVListDetails.xml index 80e40036..b8d217b2 100644 --- a/components/tvshows/TVListDetails.xml +++ b/components/tvshows/TVListDetails.xml @@ -3,12 +3,13 @@ - - - - - - + + + + + + From e4e942fa740d444e263f66d769ea7e89b74c38e9 Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Wed, 28 Dec 2022 15:31:17 -0700 Subject: [PATCH 5/8] slight resizing --- components/tvshows/TVListDetails.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/tvshows/TVListDetails.xml b/components/tvshows/TVListDetails.xml index b8d217b2..a3134768 100644 --- a/components/tvshows/TVListDetails.xml +++ b/components/tvshows/TVListDetails.xml @@ -5,10 +5,11 @@ - + + - - From dc33ccd6ddb69e5e0ce8953e0309592b115052fd Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Wed, 28 Dec 2022 15:35:50 -0700 Subject: [PATCH 6/8] improve checkmark alignment --- components/tvshows/TVListDetails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tvshows/TVListDetails.xml b/components/tvshows/TVListDetails.xml index a3134768..aaf504de 100644 --- a/components/tvshows/TVListDetails.xml +++ b/components/tvshows/TVListDetails.xml @@ -5,7 +5,7 @@ - From 554bcd1ae9b731e119024c075de0b3cdd626c78e Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Thu, 29 Dec 2022 15:56:18 -0700 Subject: [PATCH 7/8] increase checkmark font size to 35 --- components/tvshows/TVListDetails.brs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index 7cdba1f5..708f12ca 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -11,6 +11,8 @@ sub init() m.progressBackground = m.top.findNode("progressBackground") m.progressBar = m.top.findnode("progressBar") m.playedIndicator = m.top.findNode("playedIndicator") + m.checkmark = m.top.findNode("checkmark") + m.checkmark.font.size = 35 end sub sub itemContentChanged() From ced88a81d1182f62d875c8ae6d8ab10b122d551d Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Thu, 29 Dec 2022 16:05:22 -0700 Subject: [PATCH 8/8] restore imgParams for maxWidth and maxHeight --- source/api/Items.brs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/api/Items.brs b/source/api/Items.brs index 61a36e26..9e94f447 100644 --- a/source/api/Items.brs +++ b/source/api/Items.brs @@ -389,8 +389,9 @@ function TVEpisodes(show_id as string, season_id as string) data = getJson(resp) results = [] for each item in data.Items + imgParams = { "maxWidth": 400, "maxheight": 250 } tmp = CreateObject("roSGNode", "TVEpisodeData") - tmp.image = PosterImage(item.id) + tmp.image = PosterImage(item.id, imgParams) if tmp.image <> invalid tmp.image.posterDisplayMode = "scaleToZoom" end if