Skip to content

Commit f2c796f

Browse files
committed
Update code docs
1 parent 9a4d565 commit f2c796f

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

docs/components_ItemGrid_LoadVideoContentTask.bs.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import "pkg:/source/api/Image.bs"
66
import "pkg:/source/api/Items.bs"
77
import "pkg:/source/api/userauth.bs"
8+
import "pkg:/source/constants/imageSize.bs"
89
import "pkg:/source/enums/SubtitleSelection.bs"
910
import "pkg:/source/roku_modules/log/LogMixin.brs"
1011
import "pkg:/source/utils/config.bs"
@@ -164,36 +165,39 @@
164165
end if
165166

166167
' Set logo image using metadata (same logic as ItemDetails)
168+
' All OSD logo images are sized to imageSize.LOGO_OSD — the Poster node in OSD.xml enforces
169+
' this client-side via loadWidth/loadHeight with loadDisplayMode="noScale", so the API params and UI stay in sync.
170+
osdLogoSize = imageSize.LOGO_OSD ' { width: 500, height: 300 } — BrightScript requires local var for namespace field access
167171
' Check for logoImageTag first (movie/item logo)
168172
if isValidAndNotEmpty(meta.logoImageTag)
169-
video.logoImage = ImageURL(meta.id, "Logo", { maxHeight: 212, maxWidth: 500, quality: 90, tag: meta.logoImageTag })
173+
video.logoImage = ImageURL(meta.id, "Logo", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.logoImageTag })
170174
else if isValidAndNotEmpty(meta.parentLogoImageTag) and isValidAndNotEmpty(meta.seriesId)
171175
' Series logo for episodes
172-
video.logoImage = ImageURL(meta.seriesId, "Logo", { maxHeight: 212, maxWidth: 500, quality: 90, tag: meta.parentLogoImageTag })
176+
video.logoImage = ImageURL(meta.seriesId, "Logo", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.parentLogoImageTag })
173177
else if videotype = "movie" and isValidAndNotEmpty(meta.primaryImageTag)
174178
' Movie with no logo — fall back to primary (poster) image
175-
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: 534, maxWidth: 500, quality: 90, tag: meta.primaryImageTag })
179+
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.primaryImageTag })
176180
else if videotype = "episode" or videotype = "recording"
177181
' Episode/recording with no series logo — fall back to series primary poster, then episode thumbnail
178182
if isValidAndNotEmpty(meta.seriesPrimaryImageTag) and isValidAndNotEmpty(meta.seriesId)
179-
video.logoImage = ImageURL(meta.seriesId, "Primary", { maxHeight: 534, maxWidth: 500, quality: 90, tag: meta.seriesPrimaryImageTag })
183+
video.logoImage = ImageURL(meta.seriesId, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.seriesPrimaryImageTag })
180184
else if isValidAndNotEmpty(meta.primaryImageTag)
181-
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: 212, maxWidth: 500, quality: 90, tag: meta.primaryImageTag })
185+
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.primaryImageTag })
182186
end if
183187
else if videotype = "tvchannel"
184188
' For live TV channels, prefer the currently-airing program's artwork over the channel icon.
185189
' Priority: program logo → program primary (poster) → channel icon (fallback).
186190
currentProgram = meta.currentProgram
187191
if isValid(currentProgram)
188192
if isValidAndNotEmpty(currentProgram.logoImageTag)
189-
video.logoImage = ImageURL(currentProgram.id, "Logo", { maxHeight: 212, maxWidth: 500, quality: 90, tag: currentProgram.logoImageTag })
193+
video.logoImage = ImageURL(currentProgram.id, "Logo", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: currentProgram.logoImageTag })
190194
else if isValidAndNotEmpty(currentProgram.primaryImageTag)
191-
video.logoImage = ImageURL(currentProgram.id, "Primary", { maxHeight: 534, maxWidth: 500, quality: 90, tag: currentProgram.primaryImageTag })
195+
video.logoImage = ImageURL(currentProgram.id, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: currentProgram.primaryImageTag })
192196
else if isValidAndNotEmpty(meta.primaryImageTag)
193-
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: 212, maxWidth: 212, quality: 90, tag: meta.primaryImageTag })
197+
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.primaryImageTag })
194198
end if
195199
else if isValidAndNotEmpty(meta.primaryImageTag)
196-
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: 212, maxWidth: 212, quality: 90, tag: meta.primaryImageTag })
200+
video.logoImage = ImageURL(meta.id, "Primary", { maxHeight: osdLogoSize.height, maxWidth: osdLogoSize.width, quality: 90, tag: meta.primaryImageTag })
197201
end if
198202
end if
199203

0 commit comments

Comments
 (0)