Set source + content + scraper (In one action)
#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?
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#2
Trigger a script with your onclick that uses JSON-RPC in order to modify the GUISettings
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#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?
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#4
Don't think JSON-RPC allows that. Check the wiki for options
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#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
Reply
#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)
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#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
Reply
#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
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#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
Reply
#10
I would still be interested in the dirty hacks.
Just to get a proof of concept .zip for the skin up.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#11
You can access the GUISettings through HTTP/API for now, once JSON-RPC has a method for editing then that will be the best method.

You can also directly access the guisettings.xml file in userdata. It should not be too difficult to modify the proper sections.
Code:
<musiclibrary>
        <albumsscraper>metadata.album.universal</albumsscraper>
        <artistsscraper>metadata.artists.universal</artistsscraper>
        <backgroundupdate>false</backgroundupdate>
        <cleanup></cleanup>
        <downloadinfo>true</downloadinfo>
        <enabled>true</enabled>
        <export></export>
        <import></import>
        <showcompilationartists>true</showcompilationartists>
        <updateonstartup>false</updateonstartup>
    </musiclibrary>
Code:
<scrapers>
        <moviesdefault>metadata.themoviedb.org</moviesdefault>
        <musicvideosdefault>metadata.yahoomusic.com</musicvideosdefault>
        <tvshowsdefault>metadata.tvdb.com</tvshowsdefault>
    </scrapers>
Also sources.xml can be directly edited.
Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1"></path>
            <path pathversion="1"></path>
            <path pathversion="1"></path>
        </source>
        <source>
            <name>Music Videos</name>
            <path pathversion="1"></path>
        </source>
        <source>
            <name>TV Shows</name>
            <path pathversion="1"></path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>cd</name>
            <path pathversion="1">cdda://local/</path>
        </source>
        <source>
            <name>Albums</name>
            <path pathversion="1"></path>
            <path pathversion="1"></path>
            <path pathversion="1"></path>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>Picture</name>
            <path pathversion="1"></path>
        </source>
    </files>
</sources>

I believe XBMC creates these files(though fairly empty) upon first run.
Reply

Logout Mark Read Team Forum Stats Members Help
Set source + content + scraper (In one action)0