2019-03-05 04:31:58 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
|
|
<component name="MovieRow" extends="RowList">
|
|
|
|
<interface>
|
2019-03-05 05:18:01 +00:00
|
|
|
<field id="rowSize" type="int" />
|
|
|
|
<field id="movieData" type="associativearray" onChange="setData" />
|
2019-03-05 04:31:58 +00:00
|
|
|
</interface>
|
|
|
|
<script type="text/brightscript" uri="pkg:/source/config.brs" />
|
|
|
|
<script type="text/brightscript" uri="pkg:/source/JellyfinAPI.brs" />
|
|
|
|
<script type="text/brightscript">
|
|
|
|
<![CDATA[
|
|
|
|
sub init()
|
|
|
|
m.top.itemComponentName = "MovieItem"
|
|
|
|
m.top.content = getData()
|
|
|
|
|
|
|
|
m.top.numrows = 1
|
|
|
|
m.top.rowSize = 4
|
|
|
|
|
|
|
|
m.top.visible = true
|
2019-03-07 05:30:06 +00:00
|
|
|
m.top.itemSize = [200 * 4 + 20 * 3, 400]
|
|
|
|
m.top.rowHeights = [400]
|
|
|
|
m.top.rowItemSize = [ [200, 400] ]
|
|
|
|
m.top.itemSpacing = [ 0, 50 ]
|
2019-03-05 04:31:58 +00:00
|
|
|
m.top.rowItemSpacing = [ [20, 0] ]
|
|
|
|
m.top.rowLabelOffset = [ [0, 30] ]
|
|
|
|
|
|
|
|
m.top.rowFocusAnimationStyle = "floatingFocus"
|
2019-03-07 05:30:06 +00:00
|
|
|
'm.top.vertFocusAnimationStyle = "floatingFocus"
|
2019-03-05 04:31:58 +00:00
|
|
|
|
|
|
|
m.top.showRowLabel = [false]
|
|
|
|
|
|
|
|
m.top.setfocus(true)
|
|
|
|
end sub
|
|
|
|
|
|
|
|
function setData()
|
2019-03-08 02:03:19 +00:00
|
|
|
movieData = m.top.movieData
|
2019-03-05 04:31:58 +00:00
|
|
|
rowsize = m.top.rowSize
|
|
|
|
|
2019-03-08 02:03:19 +00:00
|
|
|
n = movieData.items.count()
|
2019-03-05 04:31:58 +00:00
|
|
|
|
|
|
|
' Test for no remainder
|
|
|
|
if int(n/rowsize) = n/rowsize then
|
|
|
|
m.top.numRows = n/rowsize
|
|
|
|
else
|
|
|
|
m.top.numRows = n/rowsize + 1
|
|
|
|
end if
|
|
|
|
|
|
|
|
m.top.content = getData()
|
|
|
|
end function
|
|
|
|
|
|
|
|
function getData()
|
|
|
|
if m.top.movieData = invalid then
|
|
|
|
data = CreateObject("roSGNode", "ContentNode")
|
|
|
|
return data
|
|
|
|
end if
|
|
|
|
|
2019-03-08 02:03:19 +00:00
|
|
|
movieData = m.top.movieData
|
2019-03-05 04:31:58 +00:00
|
|
|
rowsize = m.top.rowSize
|
|
|
|
data = CreateObject("roSGNode", "ContentNode")
|
|
|
|
for rownum=1 to m.top.numRows
|
|
|
|
row = data.CreateChild("ContentNode")
|
|
|
|
for i=1 to rowsize
|
|
|
|
index = (rownum - 1) * rowsize + i
|
2019-03-08 02:03:19 +00:00
|
|
|
if index > movieData.items.count() then
|
2019-03-05 04:31:58 +00:00
|
|
|
exit for
|
|
|
|
end if
|
2019-03-08 02:03:19 +00:00
|
|
|
datum = movieData.Items[index-1]
|
2019-03-05 04:31:58 +00:00
|
|
|
item = row.CreateChild("MovieItemData")
|
2019-03-07 05:30:06 +00:00
|
|
|
item.title = datum.name
|
2019-03-05 04:31:58 +00:00
|
|
|
item.movieID = datum.id
|
2019-03-07 05:30:06 +00:00
|
|
|
item.posterUrl = ImageURL(datum.id)
|
2019-03-08 02:03:19 +00:00
|
|
|
item.description = datum.overview
|
|
|
|
item.full_data = datum
|
2019-03-05 04:31:58 +00:00
|
|
|
end for
|
|
|
|
end for
|
|
|
|
return data
|
|
|
|
end function
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
</component>
|