Set source + content + scraper (In one action)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MassIV Offline
Donor
Posts: 712
Joined: Mar 2012
Reputation: 21
Post: #1
Hey guys,

I'm looking to do the following:

Onclick, open a "browse for source" to the user. (so not the add source dialog, but the browse function inside of it)
The user browses for the folder.
On clicking "ok"
Set the folder as source (obviously)
Set the content of the folder as the type that i specify in the xml.
Set the scraper (if not automatically set to default)
Set scan recursively
Set movies are in separate folders (if type is movies..).

So where can i find these commands? Or another way to do this?
find quote
mad-max Offline
Posting Freak
Posts: 1,476
Joined: Jul 2010
Reputation: 52
Location: Germany
Post: #2
Trigger a script with your onclick that uses JSON-RPC in order to modify the GUISettings

[Image: obi3o55x.jpg]
[Image: 7c8w3bu8.png]

- - - Tribute to Metallica - - -

If I managed to help you, please click my reputation
find quote
MassIV Offline
Donor
Posts: 712
Joined: Mar 2012
Reputation: 21
Post: #3
Hey thanks for pointing me in the right direction. But this will be my first time trying to do that (or even looking at JSON).
Are there any good examples of how to use that? Tutorials (with xbmc instead of http) / other skins / plugins that make use of this?
find quote
Martijn Online
Team-XBMC
Posts: 7,696
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #4
Don't think JSON-RPC allows that. Check the wiki for options

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
butchabay Offline
Skilled Skinner
Posts: 3,420
Joined: Mar 2010
Reputation: 62
Location: Switzerland
Post: #5
(2012-08-07 07:14)MassIV Wrote:  Hey thanks for pointing me in the right direction. But this will be my first time trying to do that (or even looking at JSON).
Are there any good examples of how to use that? Tutorials (with xbmc instead of http) / other skins / plugins that make use of this?

http://forum.xbmc.org/showthread.php?tid=134129
find quote
MassIV Offline
Donor
Posts: 712
Joined: Mar 2012
Reputation: 21
Post: #6
Trying to open browse dialog fails.

XBMC\addons\skin.name\scripts\myScript.py

Code:
import os
import xbmcgui
import sys

dialog = xbmcgui.Dialog()
fn = dialog.browse(0, 'XBMC', 'files', '', False, False, 'C:\')
Opened by:
Code:
<control type="button" id="97">
    <include>button_Category</include>
    <label>Video folder</label>
    <onclick>RunScript(special://skin/scripts/myScript.py)</onclick>
</control>


-edit-
Then again my 'Hello world' also fails.
Also tried
XBMC.RunScript(C:\real\path\to\myScript.py)
(This post was last modified: 2012-08-07 16:00 by MassIV.)
find quote
`Black Offline
Skilled Skinner
Posts: 2,002
Joined: Apr 2009
Reputation: 49
Location: Germany
Post: #7
Are you adding tons of sources every day or why do you want to do it in one action? I may have a way but I don't think it makes much sense to add it to a skin.

[Image: xp1080.png]
find quote
MassIV Offline
Donor
Posts: 712
Joined: Mar 2012
Reputation: 21
Post: #8
Trying to make a skin dedicated to setting up XBMC. So if i want to change the order of the setup i kind of need to be able to set those commands separately.
Going off a feature suggestion:
http://forum.xbmc.org/showthread.php?tid=137501
find quote
`Black Offline
Skilled Skinner
Posts: 2,002
Joined: Apr 2009
Reputation: 49
Location: Germany
Post: #9
Ok, then I would wait if someone is willing to add the needed functionality to XBMC. You can only achieve it with dirty hacks at the moment. But I like the idea of a general wizard and I think this should be integrated natively.

[Image: xp1080.png]
(This post was last modified: 2012-08-07 17:51 by `Black.)
find quote
MassIV Offline
Donor
Posts: 712
Joined: Mar 2012
Reputation: 21
Post: #10
I would still be interested in the dirty hacks.
Just to get a proof of concept .zip for the skin up.
find quote
Post Reply