Merge pull request #955 from 1hitsong/SpeedUpHomeViewLoad
Make Home View load faster
This commit is contained in:
commit
a0979b930c
|
@ -61,10 +61,13 @@ sub onLibrariesLoaded()
|
||||||
m.LoadLibrariesTask.content = []
|
m.LoadLibrariesTask.content = []
|
||||||
' create My Media, Continue Watching, and Next Up rows
|
' create My Media, Continue Watching, and Next Up rows
|
||||||
content = CreateObject("roSGNode", "ContentNode")
|
content = CreateObject("roSGNode", "ContentNode")
|
||||||
|
|
||||||
mediaRow = content.CreateChild("HomeRow")
|
mediaRow = content.CreateChild("HomeRow")
|
||||||
mediaRow.title = tr("My Media")
|
mediaRow.title = tr("My Media")
|
||||||
|
|
||||||
continueRow = content.CreateChild("HomeRow")
|
continueRow = content.CreateChild("HomeRow")
|
||||||
continueRow.title = tr("Continue Watching")
|
continueRow.title = tr("Continue Watching")
|
||||||
|
|
||||||
nextUpRow = content.CreateChild("HomeRow")
|
nextUpRow = content.CreateChild("HomeRow")
|
||||||
nextUpRow.title = tr("Next Up >")
|
nextUpRow.title = tr("Next Up >")
|
||||||
|
|
||||||
|
@ -113,10 +116,14 @@ sub onLibrariesLoaded()
|
||||||
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
m.LoadContinueTask.observeField("content", "updateContinueItems")
|
||||||
m.LoadContinueTask.control = "RUN"
|
m.LoadContinueTask.control = "RUN"
|
||||||
|
|
||||||
|
m.LoadNextUpTask.observeField("content", "updateNextUpItems")
|
||||||
|
m.LoadNextUpTask.control = "RUN"
|
||||||
|
|
||||||
' Load the Favorites Data
|
' Load the Favorites Data
|
||||||
m.LoadFavoritesTask.observeField("content", "updateFavoritesItems")
|
m.LoadFavoritesTask.observeField("content", "updateFavoritesItems")
|
||||||
m.LoadFavoritesTask.control = "RUN"
|
m.LoadFavoritesTask.control = "RUN"
|
||||||
|
|
||||||
|
|
||||||
' If we have Live TV access, load "On Now" data
|
' If we have Live TV access, load "On Now" data
|
||||||
if haveLiveTV
|
if haveLiveTV
|
||||||
m.LoadOnNowTask.observeField("content", "updateOnNowItems")
|
m.LoadOnNowTask.observeField("content", "updateOnNowItems")
|
||||||
|
@ -219,9 +226,6 @@ 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()
|
||||||
|
@ -274,7 +278,6 @@ sub updateNextUpItems()
|
||||||
m.global.app_loaded = true
|
m.global.app_loaded = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|
||||||
' create task nodes for "Latest In" rows
|
' create task nodes for "Latest In" rows
|
||||||
userConfig = m.top.userConfig
|
userConfig = m.top.userConfig
|
||||||
filteredLatest = filterNodeArray(m.libraryData, "id", userConfig.LatestItemsExcludes)
|
filteredLatest = filterNodeArray(m.libraryData, "id", userConfig.LatestItemsExcludes)
|
||||||
|
|
|
@ -30,6 +30,7 @@ sub loadItems()
|
||||||
params["ParentId"] = m.top.itemId
|
params["ParentId"] = m.top.itemId
|
||||||
params["EnableImageTypes"] = "Primary,Backdrop,Thumb"
|
params["EnableImageTypes"] = "Primary,Backdrop,Thumb"
|
||||||
params["ImageTypeLimit"] = 1
|
params["ImageTypeLimit"] = 1
|
||||||
|
params["EnableTotalRecordCount"] = false
|
||||||
|
|
||||||
resp = APIRequest(url, params)
|
resp = APIRequest(url, params)
|
||||||
data = getJson(resp)
|
data = getJson(resp)
|
||||||
|
@ -53,6 +54,10 @@ sub loadItems()
|
||||||
params["SortOrder"] = "Descending"
|
params["SortOrder"] = "Descending"
|
||||||
params["ImageTypeLimit"] = 1
|
params["ImageTypeLimit"] = 1
|
||||||
params["UserId"] = get_setting("active_user")
|
params["UserId"] = get_setting("active_user")
|
||||||
|
params["EnableRewatching"] = false
|
||||||
|
params["DisableFirstEpisode"] = false
|
||||||
|
params["limit"] = 24
|
||||||
|
params["EnableTotalRecordCount"] = false
|
||||||
|
|
||||||
maxDaysInNextUp = get_user_setting("ui.details.maxdaysnextup", "365")
|
maxDaysInNextUp = get_user_setting("ui.details.maxdaysnextup", "365")
|
||||||
if isValid(maxDaysInNextUp)
|
if isValid(maxDaysInNextUp)
|
||||||
|
@ -64,9 +69,6 @@ sub loadItems()
|
||||||
dateCutoff.FromSeconds(dateToday.AsSeconds() - (maxDaysInNextUp * 86400))
|
dateCutoff.FromSeconds(dateToday.AsSeconds() - (maxDaysInNextUp * 86400))
|
||||||
|
|
||||||
params["NextUpDateCutoff"] = dateCutoff.ToISOString()
|
params["NextUpDateCutoff"] = dateCutoff.ToISOString()
|
||||||
params["EnableRewatching"] = false
|
|
||||||
params["DisableFirstEpisode"] = false
|
|
||||||
params["limit"] = 24
|
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
@ -88,6 +90,7 @@ sub loadItems()
|
||||||
params["SortBy"] = "DatePlayed"
|
params["SortBy"] = "DatePlayed"
|
||||||
params["SortOrder"] = "Descending"
|
params["SortOrder"] = "Descending"
|
||||||
params["Filters"] = "IsResumable"
|
params["Filters"] = "IsResumable"
|
||||||
|
params["EnableTotalRecordCount"] = false
|
||||||
|
|
||||||
resp = APIRequest(url, params)
|
resp = APIRequest(url, params)
|
||||||
data = getJson(resp)
|
data = getJson(resp)
|
||||||
|
@ -109,6 +112,7 @@ sub loadItems()
|
||||||
params["Limit"] = 20
|
params["Limit"] = 20
|
||||||
params["recursive"] = true
|
params["recursive"] = true
|
||||||
params["sortby"] = "random"
|
params["sortby"] = "random"
|
||||||
|
params["EnableTotalRecordCount"] = false
|
||||||
|
|
||||||
resp = APIRequest(url, params)
|
resp = APIRequest(url, params)
|
||||||
data = getJson(resp)
|
data = getJson(resp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user