Installing Addons from a button...

Discussion and development of skins for XBMC4XBOX
User avatar
Dan Dar3
Posts: 1176
Joined: Sun Jul 08, 2012 4:09 pm
Has thanked: 273 times
Been thanked: 257 times
Contact:

Re: Installing Addons from a button...

Post by Dan Dar3 »

Mmm, second look, the problem might be somewhere else - System.HasAddon() has a problem to match "script.cu.lrcyrics" to Q:\scripts\CU LRC Lyrics".
The current code will match script.cu.lrclyrics" to "CU LRCLyrics" - it would need "script.cu.lrc.lyrics" in the condition - dots are converted to spaces when checking whether it exists on disk.
User avatar
byron
Posts: 582
Joined: Wed Jul 04, 2012 9:26 pm
Location: Illinois
Has thanked: 27 times
Been thanked: 96 times

Re: Installing Addons from a button...

Post by byron »

If I get this right, might not be a problem with System.HasAddon() condition, but with double "onclick" property? appears only the second one is considered...If that if the case, is it possible to add two button that overlap, each controlled by the condition (one poitive one negative) so that only one is visibile at a time? This way each will have their own click that would run correctly.
Yea I thought the same thing, tried that before I posted. The above method works with 2/3 of the scripts that I've tried so I don't think that's the problem (individual buttons didn't work btw) Hmm, maybe it has something to do with the script? Anyway, thanks for getting back to me while you're on vacation...I'll just keep messing around with it and see what I can come up with.

----edit----
Just saw this other post you made...I'll try the other "." and see if that works.

---edit 2----
Yup...that worked, good thinking ;)
Ponchofcult
Posts: 11
Joined: Sun Aug 24, 2014 9:18 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Installing Addons from a button...

Post by Ponchofcult »

Hello i don't understand so much English but what button you are programming? i'm trying to investigate how to add the "add ons" button on settings menu and do it functional and too the "get more" buttons because must be more easy install addons like in a normal xbmc too i want that the scripts, skins, plugins, modules stay in the same addons folder
User avatar
byron
Posts: 582
Joined: Wed Jul 04, 2012 9:26 pm
Location: Illinois
Has thanked: 27 times
Been thanked: 96 times

Re: Installing Addons from a button...

Post by byron »

This thread revolves around adding 2 (possibly more) functions to one button (where the system has an addon installed and when it doesn't), and I've been referring to the Lyrics/Subtitles media buttons throughout. What you're suggesting I've already done somewhat with my rapier mod (in my signature below) with an ADDON home menu item that links to the repo (and it's submenu links to all of the various parts...video, music, modules etc.) Also home menu MUSIC, PICUTURES, VIDEOS, PROGRAMS etc have submenus which link directly to the repo for their perspective categories...you can check the code to see what I did if you're interested or just try the skin and see if that's what you're looking for. As far as the "get more" button inside of the specific containers I'm not sure what to tell you. What I've had success with is saving an item from the repo to favourites, opening up favourites.xml and copying the link to a button control <onclick> function and then it works itself out from there...hope that helps.
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Installing Addons from a button...

Post by BuZz »

I think he is referring to proper addons support (having them in the same folder managed by a database etc). In another post he referenced a video I made of my WIP addons branch which has basic addons support (and lots of bugs/problems)
Ponchofcult wrote:Hello i don't understand so much English but what button you are programming? i'm trying to investigate how to add the "add ons" button on settings menu and do it functional and too the "get more" buttons because must be more easy install addons like in a normal xbmc too i want that the scripts, skins, plugins, modules stay in the same addons folder
xbmc4xbox does not support this - we still have the old system of plugins in separate folders. We can only run xbmc addons currently due to having an updated python, an emulation library or two for python, and an installer script that helps with dependencies.
Ponchofcult
Posts: 11
Joined: Sun Aug 24, 2014 9:18 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Installing Addons from a button...

Post by Ponchofcult »

BuZz wrote:xbmc4xbox does not support this - we still have the old system of plugins in separate folders. We can only run xbmc addons currently due to having an updated python, an emulation library or two for python, and an installer script that helps with dependencies.
humm ok! thank you! yes i see that it's very complicated for the differences between it and really with addons4xbox not so much useful, and too i tried to put in the addon settings menu a shortcut to the addons4xbox but i don't know how, really the only thing that i wish you adopt from the normal xbmc is the automatically start addons using services to update automatically the episodes in my library
User avatar
byron
Posts: 582
Joined: Wed Jul 04, 2012 9:26 pm
Location: Illinois
Has thanked: 27 times
Been thanked: 96 times

Re: Installing Addons from a button...

Post by byron »

Okay, thought I had this figured out...apparently I do not. Again, the way I'm trying to install these scripts is by navigating to the addon in the XBMC repo and saving the link to favourites so that I can copy that link from the favourites.xml and then paste it into my button control.

Just found out this won't work on a fresh install (ie. no favourites.xml) because unless the favourite is actually there xbmc4xbox won't install it. Once I navigate to the script location in the repo, add it to favourites, go back and try to install via the lyrics button I'm working on wallah it works! Here's the function with the link for CU LRC Lyrics (without &quote; btw):

Code: Select all

<onclick condition="!System.HasAddon(script.cu.lrc.lyrics)">RunPlugin(plugin://programs/Addons4Xbox Installer/?installfromrepo=true&addonname=CU+LRC+Lyrics&url=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo%2Fscript.cu.lrclyrics%2Fscript.cu.lrclyrics-1.0.7.zip&datadir=http%3A%2F%2Fmirrors.xbmc.org%2Faddons%2Ffrodo&addonid=script.cu.lrclyrics&type=zip&repoid=repository.xbmc.org)</onclick>
Can anybody help think of a different way to remotely install a script on xbmc4xbox from the reop or why this isn't working?

I know it's just a snippet, but here's what python is telling me is happening and why it's not working without the favourite being previously made:

Code: Select all

12:21:20 M: 20860928  NOTICE: -->Python Initialized<--
12:21:26 M: 16961536  NOTICE: Traceback (most recent call last):
12:21:26 M: 16961536  NOTICE:   File "Q:\plugins\programs\Addons4Xbox Installer\default.py", line 149, in select
12:21:26 M: 16957440  NOTICE:     plugin.Main()
12:21:26 M: 16957440  NOTICE:   File "Q:\plugins\programs\Addons4Xbox Installer\resources\libs\Addons4Xbox_install_remote.py", line 36, in __init__
12:21:26 M: 16957440  NOTICE:     status = self._install_addon_remote()
12:21:26 M: 16957440  NOTICE:   File "Q:\plugins\programs\Addons4Xbox Installer\resources\libs\Addons4Xbox_install_remote.py", line 65, in _install_addon_remote
12:21:26 M: 16957440  NOTICE:     requiredLibs = addonDic[addonId]['required_lib']
12:21:26 M: 16957440  NOTICE: TypeError: 'NoneType' object has no attribute '__getitem__'
12:21:26 M: 16957440   ERROR:  XFILE::CPluginDirectory::EndOfDirectory - called with an invalid handle.

----edit----
So after more obsession with this, I've found that it most likely has nothing to do with favourites at all. I deleted all of my userdata that pertained to CU LRC Lyrics and a4x, also deleted the script and started over (many times). The only way that I've gotten it to start the install (which again has nothing to do with favourites I'm pretty sure) was to navigate into programs/a4x/get addons/xbmc repo/scripts...once I backed out of that and then tried to install from the button it worked. So I'm thinking that since the repo hasn't ever been opened on a fresh install, calling on a4x to install something will never work because the repo has never been seen before by xbmc4xbox. I've spent too much time thinking about this :x
Post Reply