Skip to content

Commit 4971fef

Browse files
committed
Update code docs
1 parent 10a9abb commit 4971fef

5 files changed

Lines changed: 49 additions & 13 deletions

docs/components_ItemGrid_LoadItemsTask2.bs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
if m.top.ItemType = "LogoImage"
3737
logoImageExists = api.items.HeadImageURLByName(m.top.itemId, "logo")
3838
if logoImageExists
39-
m.top.content = [api.items.GetImageURL(m.top.itemId, "logo", 0, { "maxHeight": 500, "maxWidth": 500, "quality": "90" })]
39+
m.top.content = [api.items.GetImageURL(m.top.itemId, "logo", 0, { "maxHeight": 212, "maxWidth": 500, "quality": "90" })]
4040
else
4141
m.top.content = []
4242
end if

docs/components_ItemGrid_LoadVideoContentTask.bs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171
logoImageExists = api.items.HeadImageURLByName(logoLookupID, "logo")
172172
if logoImageExists
173-
video.json.logoImage = api.items.GetImageURL(logoLookupID, "logo", 0, { "maxHeight": 300, "maxWidth": 500, "quality": "90" })
173+
video.json.logoImage = api.items.GetImageURL(logoLookupID, "logo", 0, { "maxHeight": 212, "maxWidth": 500, "quality": "90" })
174174
end if
175175

176176
if LCase(m.top.itemType) = "episode"

docs/components_movies_MovieDetails.bs.html

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@
2525
m.buttonGrp.setFocus(true)
2626
m.top.lastFocus = m.buttonGrp
2727

28-
' Movie logo - positioned in bottom right
28+
' Movie logo - positioned at fixed Y position
2929
m.movieLogo = m.top.findNode("movieLogo")
3030
m.movieLogo.observeField("loadStatus", "onLogoLoadStatusChanged")
3131

32+
' Date added label - positioned at bottom right
33+
m.dateCreatedLabel = m.top.findNode("dateCreatedLabel")
34+
3235
' Gradient overlay - dynamically sized to span from itemDetails to extrasSlider
3336
m.itemTextGradient = m.top.findNode("itemTextGradient")
3437
m.itemDetails = m.top.findNode("itemDetails")
@@ -410,6 +413,9 @@
410413
' Set movie logo if available
411414
setMovieLogo(itemData)
412415

416+
' Set date added label if available
417+
setDateAdded(itemData)
418+
413419
' Set default video source if user hasn't selected one yet
414420
if m.top.selectedVideoStreamId = "" and isValid(itemData.MediaSources)
415421
m.top.selectedVideoStreamId = itemData.MediaSources[0].id
@@ -631,7 +637,7 @@
631637
' Check if logo image tag exists
632638
if isValid(itemData.ImageTags) and isValidAndNotEmpty(itemData.ImageTags.Logo)
633639
imgParams = {
634-
maxHeight: 300,
640+
maxHeight: 212,
635641
maxWidth: 500,
636642
quality: 90,
637643
tag: itemData.ImageTags.Logo
@@ -640,12 +646,42 @@
640646
m.movieLogo.uri = logoUrl
641647
else
642648
' No logo available, hide the poster
649+
m.movieLogo.visible = false
643650
m.movieLogo.uri = ""
651+
652+
end if
653+
end sub
654+
655+
' setDateAdded: Set date added label text and position
656+
' Positions label at bottom right corner of screen with 96px padding
657+
' @param itemData - The item JSON data containing DateCreated
658+
'
659+
sub setDateAdded(itemData as object)
660+
if not isValid(m.dateCreatedLabel) then return
661+
662+
if isValid(itemData.DateCreated)
663+
' Set the date and time text
664+
dateAdded = CreateObject("roDateTime")
665+
dateAdded.FromISO8601String(itemData.DateCreated)
666+
dateAdded.toLocalTime()
667+
m.dateCreatedLabel.text = tr("Added") + " " + dateAdded.AsDateString("short-month-no-weekday") + " " + formatTime(dateAdded)
668+
669+
' Position at bottom right: screen is 1920x1080, with 96px padding
670+
' Label has fixed width with horizAlign="right" for text alignment
671+
' Translation is left edge, so: rightEdge - padding - width
672+
buttonRect = m.buttonGrp.boundingRect()
673+
buttonBottom = buttonRect.y + buttonRect.height
674+
675+
m.dateCreatedLabel.translation = [1920 - 96 - 450, buttonBottom - 30]
676+
m.dateCreatedLabel.visible = true
677+
else
678+
' Hide label if no date data available
679+
m.dateCreatedLabel.visible = false
644680
end if
645681
end sub
646682

647-
' onLogoLoadStatusChanged: Position the logo after it loads
648-
' Positions logo 5% from right edge, bottom-aligned with button group
683+
' onLogoLoadStatusChanged: Position the logo with fixed Y coordinate and make it visible
684+
' Positions logo 5% from right edge at fixed Y=648
649685
'
650686
sub onLogoLoadStatusChanged()
651687
if not isValid(m.movieLogo) then return
@@ -661,17 +697,17 @@
661697
rightEdge = 1920 * 0.95
662698
logoX = rightEdge - logoWidth
663699

664-
' Calculate Y position: bottom-aligned with button group
665-
' Button group is at Y=800, get its actual height using boundingRect
666-
buttonRect = m.buttonGrp.boundingRect()
667-
buttonBottom = 800 + buttonRect.height
668-
logoY = buttonBottom - logoHeight
700+
' Fixed Y position
701+
logoY = 648
669702

703+
' Position logo before making it visible to prevent glitches
670704
m.movieLogo.translation = [logoX, logoY]
705+
m.movieLogo.visible = true
671706
end if
672707
else if m.movieLogo.loadStatus = "failed"
673708
' Logo failed to load, ensure it's hidden
674709
m.movieLogo.uri = ""
710+
m.movieLogo.visible = false
675711
end if
676712
end sub
677713

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-MovieDetails.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)