Kodi Community Forum
How do I refresh a plugin? Also how do I set a default viewpoint? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: How do I refresh a plugin? Also how do I set a default viewpoint? (/showthread.php?tid=127424)

Pages: 1 2


How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-01

I've got 2 video plugins I want to change in order to:
1) always set thumbnail viewpoint as the default
2) make a refresh context menu item that refreshes the whole plugin from the internet. I'd like to do that each time the user enters the main page of the plugin. Now it seems XBMC caches it and never refetches the content.

Any help?


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-01

I found that cachToDisc = False on #2 issue resolved it

#1 is still up for answers please Smile


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-01

Argh.. cacheToDisc=False doesn't work all that good. I want it to keep cache but I also want it to refresh when the user goes in the main url of the pligin from the main menu


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-01

After testing some stuff I found out that the way I call the plugin doesn't really refresh it.

I call it through favorites which has ActivateWindow for the call.
This apparently doesn't refresh the plugin like when you go directly to it through videos -> video add-ons

How can I make the call in favourites.xml so that it gets refreshed whenever I go there?


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - paddycarey - 2012-04-02

#1 The youtube plugin does this so you should look at that code

#2 I'm not sure what you mean by "refresh the plugin". Which plugin is this? and what data are you trying to reload and in what context?


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-02

(2012-04-02, 19:26)paddycarey Wrote: #1 The youtube plugin does this so you should look at that code

#2 I'm not sure what you mean by "refresh the plugin". Which plugin is this? and what data are you trying to reload and in what context?

Let's say the Youtube plugin

Go ahead and add Youtube -> Explore Youtube -> Categories -> Music to your favourites

Go back to the main menu and do these 2 things:

1) Press S -> Favourites -> Choose the favourite you just added and go to it
2) Go to Videos -> Video addons -> Youtube -> Explore Youtube -> Categories -> Music

The 1st way will not refresh the current listing of the Music category and show you the cached version it had before moving to main menu
The 2nd way will reload all music videos and show you a new list

How can I make the 1st way behave like the 2nd one?


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - paddycarey - 2012-04-02

It's most likely that whatever way you're using to call the script isn't calling the plugin correctly. It's more likely to be a skin issue than a plugin issue.

(EDIT: This also happens when calling a plugin from the main menu in T! but I always assumed was by design) I doubt there's anything you can do in the plugin code to stop this as it's not the plugin code at fault (i think)

Can you do exactly as you have described above (step by step) and post a full debug log to http://xbmclogs.com/ and it might be more clear.


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-02

i will post the logs laterbut till then I know that in the favourites.xml file activatewindow gets called in order to open up the plugin folder.

I don't know how the 2nd way does this and I'd like to know if i can replace activatewindow with another suitable method

I'm using aeon nox btw but i'll try this in other skins to check it out


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - paddycarey - 2012-04-02

yeah that's the problem, activatewindow only seems to call the plugin the first time you run it after boot, but a debug log will confirm that


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-02

yes it does exactly that. any solutions to my problem? can i call anything else from the favourites file?


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - paddycarey - 2012-04-02

you should probably post in the skin or favourites plugin thread, you're more likely to get some solutions there, this isn't actually an issue with a plugin but with the way it's being called by the skin


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-02

but the command exists in the favourites.xml file and i can change it. i just need the correct one.


Code:
<favourite name="New Subscription Videos">
ActivateWindow(10025,&quot;plugin://plugin.video.youtube/&quot;)
</favourite>



RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Bstrdsmkr - 2012-04-03

There are parameters that need to be passed to the youtube plugin to make it do what you want, such as:

ActivateWindow(10025,"plugin://plugin.video.youtube/?mode=play&url=http://www.youtube.com/somevideo")

I just made those up, but it should give you an idea as to what you're looking for. The only way to find out what parameters you need to pass are to look the code of the youtube addon, or ask someone familiar with it's development.

That's why paddycarey directed you to the youtube plugin thread. A lot of skinners are familiar with this process so that's a possible place to ask as well


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Vrok - 2012-04-03

This is incorrect. I'm not trying to play the video. Just trying to focus the plugin and refresh all the directory items. If you try it you'll see it doesn't work


<favourite name="New Subscription Videos" thumb="C:\Users\vrokolos\AppData\Roaming\XBMC\addons\plugin.video.youtube\thumbnails\newsubscriptions.png">ActivateWindow(10025,&quot;plugin://plugin.video.youtube/?path=/root/subscriptions/new&amp;user_feed=newsubscriptions&amp;login=true&amp;&quotWink</favourite>


There were parameters there in the first place I just didn't put it on the post to be more clear.

ActivateWindow only refreshes the directory the first time it's called otherwise It just brings it from the cache.

That is my problem! Need a solution! This is not a skinning issue or a problem with the youtube plugin.
This is the main behaviour of XBMC and it applies to all skins and video plugins I've tried.


RE: How do I refresh a plugin? Also how do I set a default viewpoint? - Bstrdsmkr - 2012-04-03

I still think you need someone with knowledge of the skinning system (not my strong suit lol), the reason being that a LOT of skins integrate favorites and custom menu items, so those folks are more familiar with what you can and can't do there.

Can you use RunPlugin() instead of ActivateWindow()? It seems to me that it's logical for xbmc to cache a windows once it's created, but if you're running the plugin, it'll create it's own window and not be cached. It's also feasible that you could use any builtin there, because if you had to use ActivateWindow(), I would think you also wouldn't have to specify it.