Limit number of directories displayed?
#1
How do i go about limiting the number of directories displayed. For example. I have a website that i'm trying to parse that has 30 pages of tv shows. I have it where all those 30 pages are displayed at once, but that causes a delay while the addon loads the 30 pages. How do i go about creating a "Next page" on kodi for every page the website has.

Possible?
Reply
#2
Why not? Create list items that will open sub-listings for your prev/next pages (if any). Also note updateListing parameter of endOfDirectory function. For subsequent pages it is better to refresh the current listing that to create a new one -- to simplify navigation in your plugin.
Reply
#3
So after the last episode I would create a list item called (Next Page) that would request the next page of the website and etc?
Reply
#4
(2017-06-03, 00:07)Roman_V_M Wrote: Why not? Create list items that will open sub-listings for your prev/next pages (if any). Also note updateListing parameter of endOfDirectory function. For subsequent pages it is better to refresh the current listing that to create a new one -- to simplify navigation in your plugin.

I tried doing what you said, well I did what I understood, not sure if that's what you meant.
But here's what I did:
In the same method that I'm parsing the episodes, I have a counter = 2 and I parse the page numbers.
If the page numbers is equal to the counter then I add a directory called " Next Page " with the path of that specific page number I reached. and then increment the counter.
It only works requesting the second page as the counter never increments, I'm guessing due to the endOfDirectory that is called at the end of each addon.

The thing with the website is that it has page numbers at the bottom, and not " Next Page "

What's another good way to approach it?
Reply
#5
Nevermind, I figured it out.
Reply
#6
I'm looking to do the same thing. How did you accomplish this.
Reply
#7
So for the website I was parsing, the selected page had a distinct color; different than the pages that did not have that color, so it had something like <page 1 = blue> <page 2 = red > <page 3 = red >... etc..
So I just parsed the page numbers and placed it in a holder, had a counter which is basically holder + 1, so when i'm at page 2, the counter is at page 3, with the url of page 3 included, added those to a directory named it nextpage and ran the whole thing recursively.
Reply

Logout Mark Read Team Forum Stats Members Help
Limit number of directories displayed?0