Skip to content

Commit 8a8cd2e

Browse files
committed
Update code docs
1 parent 3e935b3 commit 8a8cd2e

4 files changed

Lines changed: 39 additions & 15 deletions

File tree

docs/components_extras_ExtrasRowList.bs.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,33 @@
285285
sub onLikeThisLoaded()
286286
data = m.LikeThisTask.content
287287
m.LikeThisTask.unobserveField("content")
288+
itemType = m.top.type
288289
if isValid(data) and data.count() > 0
289-
m.rowLikeThis = populateRow(m.rowLikeThis, tr("More Like This"), data, rowSlotSize.ROW_HEIGHT_PORTRAIT)
290-
addRowSize(rowSlotSize.PORTRAIT)
290+
' MusicVideo and Video items are always landscape (≥4:3) and have no portrait posters —
291+
' use a wide slot so the image URL logic fetches Thumb/Backdrop instead of Primary.
292+
if itemType = "MusicVideo" or itemType = "Video"
293+
m.rowLikeThis = populateRow(m.rowLikeThis, tr("More Like This"), data, rowSlotSize.ROW_HEIGHT_WIDE)
294+
' Cannot use addRowSize() here. loadParts() seeds rowItemSize with a phantom PORTRAIT
295+
' element before any rows exist, which offsets all addRowSize() indices by one and would
296+
' leave this row still mapped to PORTRAIT. Instead, rebuild the array from the actual
297+
' content child count: PORTRAIT for every preceding row, WIDE for this (final) row.
298+
newSizes = []
299+
childCount = m.top.content.getChildCount()
300+
for i = 0 to childCount - 2
301+
newSizes.push(rowSlotSize.PORTRAIT)
302+
end for
303+
newSizes.push(rowSlotSize.WIDE)
304+
m.top.rowItemSize = newSizes
305+
else
306+
m.rowLikeThis = populateRow(m.rowLikeThis, tr("More Like This"), data, rowSlotSize.ROW_HEIGHT_PORTRAIT)
307+
addRowSize(rowSlotSize.PORTRAIT)
308+
end if
291309
else if isValid(m.rowLikeThis)
292310
m.top.content.removeChild(m.rowLikeThis)
293311
m.rowLikeThis = invalid
294312
end if
295313

296314
' SpecialFeatures only for Movie / Video / Recording — not MusicVideo, Episode, Series, or Season
297-
itemType = m.top.type
298315
if itemType <> "MusicVideo" and itemType <> "Episode" and itemType <> "Series" and itemType <> "Season"
299316
m.SpecialFeaturesTask.observeField("content", "onSpecialFeaturesLoaded")
300317
m.SpecialFeaturesTask.itemId = m.top.parentId

docs/data/search.json

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

docs/module-rowItemText.html

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

docs/source_utils_rowItemText.bs.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,49 @@
44

55
' Returns the primary display title for a row item.
66
'
7-
' - Season: returns the series name (stored in subtitle by the transformer)
8-
' - Episode: returns the series name (item.seriesName)
7+
' - Season: returns the season label (item.name, e.g. "Season 1")
8+
' - Episode: returns the episode code and title (item.subtitle, e.g. "S1E2 - Pilot")
99
' - All others: returns item.name
1010
'
1111
' @param item - JellyfinBaseItem content node
1212
' @returns Display title string, or "" if item is invalid
1313
function getRowItemTitle(item as object) as string
1414
if not isValid(item) then return ""
1515

16-
' Season: transformer stores seriesName in subtitle for primary display
16+
' Season: item.name is the season label; subtitle holds seriesName (shown as secondary text)
1717
if item.type = "Season"
18-
return item.subtitle
18+
return item.name
1919
end if
2020

21-
' Episode: show the series name as the headline (episode title goes in subtitle)
21+
' Episode: subtitle holds the pre-computed episode code + title ("S1E2 - Name");
22+
' seriesName provides context and is shown as secondary text below.
2223
if item.type = "Episode"
23-
return item.seriesName
24+
return item.subtitle
2425
end if
2526

2627
return item.name
2728
end function
2829

2930
' Returns the secondary display subtitle for a row item.
3031
'
31-
' - Season: returns the season label ("Season 1", "Season 2", etc.) from item.name
32+
' - Season: returns the series name (stored in item.subtitle by the transformer)
33+
' - Episode: returns the series name (item.seriesName)
3234
' - All others: returns the pre-computed subtitle field
33-
' (e.g., "2024 • PG-13" for Movie, "S1E2 - Title" for Episode, "2020 - Present" for Series)
35+
' (e.g., "2024 • PG-13" for Movie, "2020 - Present" for Series)
3436
'
3537
' @param item - JellyfinBaseItem content node
3638
' @returns Display subtitle string, or "" if item is invalid
3739
function getRowItemSubtitle(item as object) as string
3840
if not isValid(item) then return ""
3941

40-
' Season: name holds "Season 1", subtitle holds seriesName (used as the title)
42+
' Season: subtitle field holds the series name; name holds "Season N" (shown as title)
4143
if item.type = "Season"
42-
return item.name
44+
return item.subtitle
45+
end if
46+
47+
' Episode: series name provides context for the episode code+title shown above
48+
if item.type = "Episode"
49+
return item.seriesName
4350
end if
4451

4552
return item.subtitle

0 commit comments

Comments
 (0)