components_tvshows_TVSeasonRow.bs

sub init()
  m.top.itemComponentName = "ListPoster"
  m.top.content = getData()

  updateSize()

  m.top.visible = true
  m.top.setfocus(true)
end sub

sub updateSize()
  itemWidth = 196
  itemHeight = 320 ' width * 1.5 + text

  m.top.showRowLabel = [false]
  m.top.translation = [0, 610]
  ' rows take up full width of the screen
  m.top.itemSize = [1920, (itemHeight + 40)]
  ' size of the item in the row
  m.top.rowItemSize = [itemWidth, itemHeight]
end sub

function getData()
  if m.top.TVSeasonData = invalid
    data = CreateObject("roSGNode", "ContentNode")
    return data
  end if

  seasonData = m.top.TVSeasonData
  data = CreateObject("roSGNode", "ContentNode")
  row = data.CreateChild("ContentNode")
  row.title = "Seasons"
  for each item in seasonData.items
    row.appendChild(item)
  end for
  m.top.content = data
  return data
end function