How do I refresh a plugin? Also how do I set a default viewpoint?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #1
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?
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #2
I found that cachToDisc = False on #2 issue resolved it

#1 is still up for answers please Smile
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #3
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
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #4
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?
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #5
#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?
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #6
(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?
(This post was last modified: 2012-04-02 19:31 by Vrok.)
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #7
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.
(This post was last modified: 2012-04-02 19:38 by paddycarey.)
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #8
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
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #9
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
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #10
yes it does exactly that. any solutions to my problem? can i call anything else from the favourites file?
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #11
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
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #12
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>
(This post was last modified: 2012-04-02 20:58 by Vrok.)
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #13
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
find quote
Vrok Offline
Senior Member
Posts: 110
Joined: Feb 2011
Reputation: 0
Location: Greece
Post: #14
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\ne​wsubscriptions.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.
(This post was last modified: 2012-04-03 00:55 by Vrok.)
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #15
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.
find quote
Post Reply