jluce50 122 Posted March 8, 2015 Posted March 8, 2015 I'm curious about the persistence of addons in Kodi. Is the last view state cached when leaving the addon? The problem is that default.py should be receiving some arguments via ActivateWindow(), but they aren't being seen by the addon after the initial launch. Regardless of the values I'm passing in, it just opens to the most recent screen. I want a specific action performed each time the addon is launched, but I can't seem to make that happen. Does anyone know why this is or how to make it respect the values in ActivateWindow() on launch?
xnappo 1608 Posted March 9, 2015 Posted March 9, 2015 Can you be more specific in what you are trying to do? @ @@im85288 FYI
jluce50 122 Posted March 9, 2015 Author Posted March 9, 2015 Okay, so I have a shortcut in my skin for an addon. The custom action for the shortcut is: ActivateWindow(10025, "plugin://plugin.video.myaddon/?mode=index",return) I added a notification to default.py to display the value of "mode" prior to any action being performed. The first time I launch the addon I get a notification showing that "mode=index" and each time I navigate to a new screen within the addon I see the value of "mode". But if I navigate out of the addon back to my homescreen, then launch the addon again I get no notification at all. It just opens to the last screen I was on, ignoring the ActivateWindow parameter completely as far as I can tell. Navigating to another screen then shows the notification again. I'm trying to force the addon to display a specific menu each time it's launched. This apparent caching behavior is making that impossible.
xnappo 1608 Posted March 9, 2015 Posted March 9, 2015 (edited) So just to be clear, you are just trying to link in to the sub-menus? Like from your main menu when you go to 'Movies' it goes to 'Movies'? We had some issues with AeonNox5 where the quoting that the skin was expecting was causing some issues. @@boywhosetsfire - do you think this is the issue you found? xnappo [EDIT] Thread on this issue: http://mediabrowser.tv/community/index.php?/topic/16544-kodi-14-aeon-nox-question/ Edited March 9, 2015 by xnappo
jluce50 122 Posted March 9, 2015 Author Posted March 9, 2015 (edited) So just to be clear, you are just trying to link in to the sub-menus? Like from your main menu when you go to 'Movies' it goes to 'Movies'? We had some issues with AeonNox5 where the quoting that the skin was expecting was causing some issues. @@boywhosetsfire - do you think this is the issue you found? xnappo [EDIT] Thread on this issue: http://mediabrowser.tv/community/index.php?/topic/16544-kodi-14-aeon-nox-question/ That could be related, but I don't think so (unless there is something really weird going on). The url I'm using in ActivateWindow() works, at least when clicking the shortcut the first time. The problem is that subsequent clicks just open the addon to the last viewed screen. Default.py doesn't appear to get called at all until I navigate to a different screen. Edit: Here's a walkthrough of what I'm talking about: 1. Open Kodi 2. Click MyAddon shortcut on homescreen (configured with 'ActivateWindow(10025, "plugin://plugin.video.myaddon/?mode=index",return)') 2a. Addon launches and desired screen appears based on "mode=index" 2b. See custom notification (from default.py) showing "mode=index" 3. Navigate to other screens within addon 3a. Custom notifications displayed for each screen (e.g. "mode=listVideos") 4. Go back to Kodi homescreen (via Esc, Back button, or 'j' hotkey) 5. Click MyAddon shortcut on homescreen 5a. Most recent addon screen viewed in step 3 is displayed 5b. No notification is displayed 6. Navigate to another screen within the addon 6a. Notifications are displayed again Edited March 9, 2015 by jluce50
xnappo 1608 Posted March 10, 2015 Posted March 10, 2015 I am still not quite getting this. Isn't this working fine in all the other MB modified skins? When you said 'plugin.video.myaddon' that is just shorthand for 'plugin.video.xbmb3c' right?
jluce50 122 Posted March 10, 2015 Author Posted March 10, 2015 No, it's not an MB related addon (but I am attempting to launch it from an MB modified skin). I don't think it's skin related though. I'm just trying to figure out if caching the last view state of an addon is standard Kodi behavior or if there's something I'm missing. Shouldn't default.py be called every time an addon is launched?
xnappo 1608 Posted March 10, 2015 Posted March 10, 2015 Oh...(!) In that case you are MUCH better off asking in the Kodi forums! I thought you were trying to integrate the MediaBrowser addon into your skin. But yes, as far as I know default.py IS called every time. I vaguely remember that there is something to do with the return status of endOfDirectory and telling it not to cache...
jluce50 122 Posted March 10, 2015 Author Posted March 10, 2015 (edited) Oh...(!) In that case you are MUCH better off asking in the Kodi forums! I thought you were trying to integrate the MediaBrowser addon into your skin. But yes, as far as I know default.py IS called every time. I vaguely remember that there is something to do with the return status of endOfDirectory and telling it not to cache... Yeah, I was hoping I could get a quick answer here and it might benefit others looking to develop an addon/skin. Turned out to much harder to describe the issue than I thought That endOfDirectory tidbit is a good lead. I'll check into that. Thanks! Edited March 10, 2015 by jluce50 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now