Forum Discussion
hugetv
10 years agoVisitor
I'm using the code where you want to make open much faster
Sub showMoviesScreen()
dlg = CreateObject("roOneLineDialog")
dlg.setTitle("Loading Collection")
dlg.showBusyAnimation()
dlg.show()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetGridStyle("flat-portrait")
screen.SetDescriptionVisible(true)
screen.SetBreadcrumbText("Movies", "Session")
categoryList = getCategoryListMovies()
categoryCount = categoryList.count()
seriesList = CreateObject("roList")
screen.SetupLists(categoryCount)
screen.setListNames(categoryList)
for i = 0 to categoryCount-1
tmpMoviesList = getMoviesByCategory(categoryList[i])
screen.SetContentList(i,tmpMoviesList)
seriesList.AddTail(tmpMoviesList)
end for
screen.show()
dlg.close()
while true
msg = wait(10, port)
if msg <> invalid and type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
exit while
else if msg.isListItemSelected() then
selection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]
if selection.Title = "Search"
searchMovies()
else if selection.Title = "Favorites"
FavoritesMovies()
else
showSpringboardScreenMovies(selection)
end if
end if
end if
end while
End Sub
Function getCategoryListMovies() as object
jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://"+initConfig()+"/category.php?t=movie")
json = ParseJson(jsonAsString.GetToString())
return json
End Function
Function getMoviesByCategory(category)
jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://"+initConfig()+"/movie.php?cat="+spaceEscape(category))
json = ParseJson(jsonAsString.GetToString())
return json.Videos
End Function