Merge pull request #1195 from 1hitsong/refreshHomeRows
This commit is contained in:
commit
fea5c6f0e6
|
@ -83,18 +83,6 @@ sub onLibrariesLoaded()
|
||||||
|
|
||||||
haveLiveTV = false
|
haveLiveTV = false
|
||||||
|
|
||||||
' Load the NextUp Data
|
|
||||||
m.LoadNextUpTask.observeField("content", "updateNextUpItems")
|
|
||||||
m.LoadNextUpTask.control = "RUN"
|
|
||||||
|
|
||||||
' Load the Continue Watching Data
|
|
||||||
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
|
||||||
m.LoadContinueTask.control = "RUN"
|
|
||||||
|
|
||||||
' Load the Favorites Data
|
|
||||||
m.LoadFavoritesTask.observeField("content", "updateFavoritesItems")
|
|
||||||
m.LoadFavoritesTask.control = "RUN"
|
|
||||||
|
|
||||||
' validate library data
|
' validate library data
|
||||||
if isValid(m.libraryData) and m.libraryData.count() > 0
|
if isValid(m.libraryData) and m.libraryData.count() > 0
|
||||||
userConfig = m.global.userConfig
|
userConfig = m.global.userConfig
|
||||||
|
@ -112,42 +100,42 @@ sub onLibrariesLoaded()
|
||||||
latestInRow = content.CreateChild("HomeRow")
|
latestInRow = content.CreateChild("HomeRow")
|
||||||
latestInRow.title = tr("Latest in") + " " + lib.name + " >"
|
latestInRow.title = tr("Latest in") + " " + lib.name + " >"
|
||||||
sizeArray.Push([464, 331])
|
sizeArray.Push([464, 331])
|
||||||
|
|
||||||
loadLatest = createObject("roSGNode", "LoadItemsTask")
|
|
||||||
loadLatest.itemsToLoad = "latest"
|
|
||||||
loadLatest.itemId = lib.id
|
|
||||||
|
|
||||||
metadata = { "title": lib.name }
|
|
||||||
metadata.Append({ "contentType": lib.json.CollectionType })
|
|
||||||
loadLatest.metadata = metadata
|
|
||||||
|
|
||||||
loadLatest.observeField("content", "updateLatestItems")
|
|
||||||
loadLatest.control = "RUN"
|
|
||||||
else if lib.collectionType = "livetv"
|
else if lib.collectionType = "livetv"
|
||||||
' If we have Live TV, add "On Now"
|
' If we have Live TV, add "On Now"
|
||||||
onNowRow = content.CreateChild("HomeRow")
|
onNowRow = content.CreateChild("HomeRow")
|
||||||
onNowRow.title = tr("On Now")
|
onNowRow.title = tr("On Now")
|
||||||
sizeArray.Push([464, 331])
|
sizeArray.Push([464, 331])
|
||||||
haveLiveTV = true
|
haveLiveTV = true
|
||||||
' If we have Live TV access, load "On Now" data
|
|
||||||
if haveLiveTV
|
|
||||||
m.LoadOnNowTask.observeField("content", "updateOnNowItems")
|
|
||||||
m.LoadOnNowTask.control = "RUN"
|
|
||||||
end if
|
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.top.rowItemSize = sizeArray
|
m.top.rowItemSize = sizeArray
|
||||||
m.top.content = content
|
m.top.content = content
|
||||||
|
|
||||||
|
' Load the Continue Watching Data
|
||||||
|
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
||||||
|
m.LoadContinueTask.control = "RUN"
|
||||||
|
|
||||||
|
' Load the Favorites Data
|
||||||
|
m.LoadFavoritesTask.observeField("content", "updateFavoritesItems")
|
||||||
|
m.LoadFavoritesTask.control = "RUN"
|
||||||
|
|
||||||
|
' If we have Live TV access, load "On Now" data
|
||||||
|
if haveLiveTV
|
||||||
|
m.LoadOnNowTask.observeField("content", "updateOnNowItems")
|
||||||
|
m.LoadOnNowTask.control = "RUN"
|
||||||
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub updateHomeRows()
|
sub updateHomeRows()
|
||||||
if m.global.playstateTask.state = "run"
|
if m.global.playstateTask.state = "run"
|
||||||
m.global.playstateTask.observeField("state", "updateHomeRows")
|
m.global.playstateTask.observeField("state", "updateHomeRows")
|
||||||
else
|
return
|
||||||
m.global.playstateTask.unobserveField("state")
|
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
m.global.playstateTask.unobserveField("state")
|
||||||
|
|
||||||
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
||||||
m.LoadContinueTask.control = "RUN"
|
m.LoadContinueTask.control = "RUN"
|
||||||
end sub
|
end sub
|
||||||
|
@ -237,6 +225,9 @@ sub updateContinueItems()
|
||||||
homeRows.replaceChild(row, continueRowIndex)
|
homeRows.replaceChild(row, continueRowIndex)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
m.LoadNextUpTask.observeField("content", "updateNextUpItems")
|
||||||
|
m.LoadNextUpTask.control = "RUN"
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub updateNextUpItems()
|
sub updateNextUpItems()
|
||||||
|
@ -289,6 +280,24 @@ sub updateNextUpItems()
|
||||||
m.global.app_loaded = true
|
m.global.app_loaded = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
' create task nodes for "Latest In" rows
|
||||||
|
userConfig = m.global.userConfig
|
||||||
|
filteredLatest = filterNodeArray(m.libraryData, "id", userConfig.LatestItemsExcludes)
|
||||||
|
for each lib in filteredLatest
|
||||||
|
if lib.collectionType <> "livetv" and lib.collectionType <> "boxsets" and lib.json.CollectionType <> "Program"
|
||||||
|
loadLatest = createObject("roSGNode", "LoadItemsTask")
|
||||||
|
loadLatest.itemsToLoad = "latest"
|
||||||
|
loadLatest.itemId = lib.id
|
||||||
|
|
||||||
|
metadata = { "title": lib.name }
|
||||||
|
metadata.Append({ "contentType": lib.json.CollectionType })
|
||||||
|
loadLatest.metadata = metadata
|
||||||
|
|
||||||
|
loadLatest.observeField("content", "updateLatestItems")
|
||||||
|
loadLatest.control = "RUN"
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub updateLatestItems(msg)
|
sub updateLatestItems(msg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user