Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyfin-bot committed Nov 11, 2023
1 parent 06fe0b2 commit 063e2a7
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions docs/api/components_home_HomeRows.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
end for

m.homeSectionIndexes.Delete(sectionName)
m.homeSectionIndexes.AddReplace("count", m.homeSectionIndexes.count - 1)

m.top.content.removeChildIndex(removedSectionIndex)
end sub
Expand Down Expand Up @@ -410,10 +409,12 @@
loadLatest.itemsToLoad = "latest"
loadLatest.itemId = lib.id

metadata = { "title": lib.name }
metadata.Append({ "contentType": lib.json.CollectionType })
loadLatest.metadata = metadata
metadata = {
"title": lib.name,
"contentType": lib.json.CollectionType
}

loadLatest.metadata = metadata
loadLatest.observeField("content", "updateLatestItems")
loadLatest.control = "RUN"
end if
Expand All @@ -431,8 +432,6 @@

sectionName = "latestin" + LCase(node.metadata.title).Replace(" ", "")

rowIndex = m.homeSectionIndexes[sectionName]

if itemData.count() < 1
removeHomeSection(sectionName)
return
Expand All @@ -459,9 +458,42 @@
row.appendChild(item)
end for

' replace the old row
updateSizeArray(itemSize, rowIndex, "replace")
m.top.content.replaceChild(row, rowIndex)
rowIndex = m.homeSectionIndexes[sectionName]

' Replace the old row
if isValid(rowIndex)
updateSizeArray(itemSize, rowIndex, "replace")
m.top.content.replaceChild(row, rowIndex)
return
end if

' Determine highest index of a Lastest In section so we can append the new section after it
highestLatestHomeSectionIndex = 0

for each section in m.homeSectionIndexes
if LCase(Left(section, 6)) = "latest"
if m.homeSectionIndexes[section] > highestLatestHomeSectionIndex
highestLatestHomeSectionIndex = m.homeSectionIndexes[section]
end if
end if
end for

' We have data for a section that doesn't currently exist
rowIndex = highestLatestHomeSectionIndex + 1

' Advance all the indexes greater than or equal than our new row
for each section in m.homeSectionIndexes
if m.homeSectionIndexes[section] >= rowIndex
m.homeSectionIndexes[section]++
end if
end for

m.homeSectionIndexes.AddReplace(sectionName, rowIndex)

m.top.content.insertChild(row, rowIndex)
updateSizeArray(itemSize, rowIndex)

return
end if
end sub

Expand Down

0 comments on commit 063e2a7

Please sign in to comment.