Forum Discussion
14 Replies
- hugetvVisitorI'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 - hugetvVisitorsomeone could help
- hugetvVisitorcould have someone to help me with this please
- TheEndlessChannel SurferIt's not entirely clear what you're asking. The GridScreen will open as soon as you call screen.show(). In your code, you're not calling screen.show() until after you've loaded the data. If you call screen.show() immediately after calling screen.setListNames(categoryList), it might do what you asking, but the speed of the show will still be dependent on how long your getCategoryListMovies() takes.
- hugetvVisitor
"TheEndless" wrote:
It's not entirely clear what you're asking. The GridScreen will open as soon as you call screen.show(). In your code, you're not calling screen.show() until after you've loaded the data. If you call screen.show() immediately after calling screen.setListNames(categoryList), it might do what you asking, but the speed of the show will still be dependent on how long your getCategoryListMovies() takes.
and that I can do to get Movies Category List () to make it more Thin and care less data to enter - TheEndlessChannel Surfer
"hugetv" wrote:
"TheEndless" wrote:
It's not entirely clear what you're asking. The GridScreen will open as soon as you call screen.show(). In your code, you're not calling screen.show() until after you've loaded the data. If you call screen.show() immediately after calling screen.setListNames(categoryList), it might do what you asking, but the speed of the show will still be dependent on how long your getCategoryListMovies() takes.
and that I can do to get Movies Category List () to make it more Thin and care less data to enter
It's possible, but that's hard to say without knowing what it's doing. Getting the category list, however, may not be that slow, so adding the screen.show() where I suggested above could still result in a much faster screen opening. - hugetvVisitorthis
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.show()
screen.setListNames(categoryList)
for i = 0 to categoryCount-1
tmpMoviesList = getMoviesByCategory(categoryList[i])
screen.SetContentList(i,tmpMoviesList)
seriesList.AddTail(tmpMoviesList)
end for
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
error - TheEndlessChannel SurferThat looks like you're getting a back index back from the event. You should add a null check...
Instead ofselection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]
Break it into multiple statements...list = seriesList.GetEntry(msg.GetIndex())
if list <> invalid then
selection = list[msg.GetData()]
end if - hugetvVisitor
"TheEndless" wrote:
That looks like you're getting a back index back from the event. You should add a null check...
Instead ofselection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]
Break it into multiple statements...list = seriesList.GetEntry(msg.GetIndex())
if list <> invalid then
selection = list[msg.GetData()]
end if
I thank you very much worked - hugetvVisitorI still have the same problem it takes to load all the movies as I can make faster progress