Updatelisting=True clears everything
#1
Hi!

I have a problem with updatelisting.

1. Main Page
1.2. Movie page 1
1.3. Movie page 2
1.4 Movie page 3

When I make a new search for ex. on page 1.4 I want the results to shown up of course as 1.2 Movie page 1 and so on.
This is ok.
I use at the new listing, after the search updatelisting=True.

The problem, that in this case the wholes history is cleared. This means, if here I click on the parent folder icon, it quits from the addon.
I want in this case to go back to the Main page (1) only, but not quit.

How should I list the Main page so, that the updatelisting not clears it? Is it possible?

Thank you very much for your help!
Reply
#2
updatelisting will not push a dedicated history entry (that's the point of it). so you cannot update the main listing, only sublistings if you want the root of the addon to always be in history.
Reply
#3
Hi!

I don't really understand sorry Sad
In my case it means, I have only sublistings, since update works, and clears everything, right?
I need to list the main directory as main listing? How to do it?

Thank you!
Reply
#4
i repeat. you cannot.

you need to have a subdirectory, and the only update the listing in that subdirectory. updating the main directory will create the behavior your see - it's how it is designed to work. updatelisting = do not push a dedicated history string. so when user back out, it pops the only history entry from your addon and you are back at the listing of available addons.
Reply
#5
Ok, then I need to define the Movie pages as subdirectories and it will work, right?
How can I define these listing as subdirectories?
Reply
#6
you return an item pointing back to your plugin, with an additional parameter referring to the movie page.

e.g.

li = listitem(sys.argv[0] + '/movielisting')
xbmcPlugin.addDirectoryItem(li)

when user clicks this item in the ui your plugin is called, but with the additional parameter set in sys.argv[1].

you then look for this and process accordingly in your plugin's entry point.

remember the abstraction level you are working on. your plugin is a virtual filesystem entry - it lists directories (urls to be processed by the plugin) and files (urls to be played by the player, possibly resolved through a callback to your plugin).
Reply
#7
But in this case the default Kodi back one folder is clicked.
This means I cannot handle this in my addon.
It only quits from the addon, and that's it.
Can I somehow catch this click?
Reply
#8
please, *read* what i write. you still haven't understood the problem it seems.

current dir history

Code:
<random stuff>
<listing of available addons>
<your plugin's main listing that you keep replacing>

when user clicks back, we pop the bottom entry. see where you end up ?

you want

Code:
<random stuff>
<listing of available addons>
<your plugins main listing>
<your plugins's subdirectory listing that you keep replacing>

when user clicks back, we pop the bottom entry. see where you end up now?
Reply
#9
Yes, exactly this is what I would like to have.
At the first case happens, what actually happens and my problem, goes back to available addons.
In the second case it would go back to my plugins main listing, right?
This is what I want.

What I don't know, how can I define main listing (main folder), and after everything else as subdirectories.
Reply
#10
okay.

again, your plugin is a *VIRTUAL DIRECTORY ENTRY*.

by default we call it with sys.argv[0] = 'plugin://<your addon id>/'

this is the root listing. in that listing you return the subdirectory listing as a listitem as drafted by me above (see any random plugin or the tutorials for how you do this).

when the user then clicks that item in the gui, your plugin is called again, but this time using the url you set in the returned item above ^^^. e.g.

'plugin://<your addon id>/movielisting'

this you process in your plugin's entry point, and now return the movielisting folder instead. in the movielisting folder you add another entry e.g. 'plugin://<your addon id>/movielisting/pagex'.

you then use the 'pagex' identifier in the url to know whether or not you shall call replacelisting (user previously listed the movie listing) or not (user clicked the entry from the main listing).

make sense now ?
Reply
#11
I think we misunderstood each other.
I don't replace continuously!

This is how it works:
Main page - no replace
-Movie page 1 - no replace
-- Movie page 2 - no replace
--- Movie page 3 - no replace

Till this point I can go back historically, no problem.

But!
On the page 3 I can start a new search, or whatever, which will give new results!

Now I want this new result set to show up again from Movie page 1, and be able to show the next pages as well (without replace).
And only in this case, when a new search made I use the replace (updatelisting=True).

The first page shows up correct of the new result set, and the following pages as well (and of course I am able to go back pages as well till the first page).

The problem is, when I click the back button on the first page of the NEW result set, it don't goes to the Main directory, but it quits to the addonlists.

So, the replace, which was only called once clears the Main page as well, not only the previous Movie listing pages.

This is my problem!

Thank you, an sorry that I am asking so much!
Reply
#12
Hi!

Is it not possible to make, what I want?
You can't help anymore?
You don't want since I am too uncomprehending?
You are not here? Big Grin

Sorry, I want to close this issue.
If it is not possible to make I need to find other solution.

Thank you!
Reply
#13
so you're basically saying, on movie page 3, you want to have search listitem which will return results, but these results needs to start from movie page 1?
Reply
#14
Yes, correct.
BUT!
The main page should stay, and the previous history of the old movie pages should disappear.
So on the new resulted page1, when I click on the kodi back icon, it should go back to the main page.
Reply
#15
hmm, not sure what rest of your code looks like, but you just need to call movie directory 1 with your search results, and it SHOULD (maybe not) go back to main menu if you press back.

BUT, if I'm the user and I search for a movie and it shows me results listing and then I realize I need to search again because I searched wrong movie, so I need to browse back to movie category 3 just for Search? You may need to rethink your approach.

It may not be what you're looking for but check out my ditto addon, it has search category in main menu which will return results and open appropriate category based on the result, and pressing back it goes to main menu.
Reply

Logout Mark Read Team Forum Stats Members Help
Updatelisting=True clears everything0