|
5 | 5 | import "pkg:/source/api/Image.bs" |
6 | 6 | import "pkg:/source/api/Items.bs" |
7 | 7 | import "pkg:/source/api/userauth.bs" |
| 8 | +import "pkg:/source/constants/imageSize.bs" |
8 | 9 | import "pkg:/source/enums/SubtitleSelection.bs" |
9 | 10 | import "pkg:/source/roku_modules/log/LogMixin.brs" |
10 | 11 | import "pkg:/source/utils/config.bs" |
|
164 | 165 | end if |
165 | 166 |
|
166 | 167 | ' 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 |
167 | 171 | ' Check for logoImageTag first (movie/item logo) |
168 | 172 | 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 }) |
170 | 174 | else if isValidAndNotEmpty(meta.parentLogoImageTag) and isValidAndNotEmpty(meta.seriesId) |
171 | 175 | ' 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 }) |
173 | 177 | else if videotype = "movie" and isValidAndNotEmpty(meta.primaryImageTag) |
174 | 178 | ' 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 }) |
176 | 180 | else if videotype = "episode" or videotype = "recording" |
177 | 181 | ' Episode/recording with no series logo — fall back to series primary poster, then episode thumbnail |
178 | 182 | 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 }) |
180 | 184 | 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 }) |
182 | 186 | end if |
183 | 187 | else if videotype = "tvchannel" |
184 | 188 | ' For live TV channels, prefer the currently-airing program's artwork over the channel icon. |
185 | 189 | ' Priority: program logo → program primary (poster) → channel icon (fallback). |
186 | 190 | currentProgram = meta.currentProgram |
187 | 191 | if isValid(currentProgram) |
188 | 192 | 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 }) |
190 | 194 | 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 }) |
192 | 196 | 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 }) |
194 | 198 | end if |
195 | 199 | 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 }) |
197 | 201 | end if |
198 | 202 | end if |
199 | 203 |
|
|
0 commit comments