The branch, eden has been updated
via 72405f7f058d7f818a8d1b99d705319a2f12a9ba (commit)
from 42504c131eec333c13a7158551733ec1e9ad579c (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=72405f7f058d7f818a8d1b99d705319a2f12a9ba
commit 72405f7f058d7f818a8d1b99d705319a2f12a9ba
Author: Martijn Kaijser <[email protected]>
Date: Sun Apr 21 21:17:26 2013 +0200
[script.categories] 1.0.9
diff --git a/script.categories/addon.xml b/script.categories/addon.xml
index cbe8609..285e3a6 100644
--- a/script.categories/addon.xml
+++ b/script.categories/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.categories" name="- Categories" version="1.0.8"
provider-name="AddonScriptorDE">
+<addon id="script.categories" name="- Categories" version="1.0.9"
provider-name="AddonScriptorDE">
<requires>
<import addon="xbmc.python" version="2.0"/>
</requires>
@@ -7,11 +7,15 @@
<provides>video audio image</provides>
</extension>
<extension point="xbmc.addon.metadata">
+ <language></language>
+ <platform>all</platform>
<summary lang="en">Add your Video/Audio/Image add-ons to categories (via
context menu)</summary>
<summary lang="de">Video/Audio/Image Add-ons per Kontextmenü zu
Kategorien hinzufügen</summary>
- <language></language>
<description lang="en">Add your Video/Audio/Image add-ons to categories
(via context menu)</description>
<description lang="de">Video/Audio/Image Add-ons per Kontextmenü zu
Kategorien hinzufügen</description>
- <platform>all</platform>
+ <website></website>
+ <source>https://github.com/AddonScriptorDE/script.categories</source>
+ <forum>http://forum.xbmc.org/showthread.php?tid=154668</forum>
+ <email>AddonScriptorDE at yahoo dot de</email>
</extension>
</addon>
diff --git a/script.categories/changelog.txt b/script.categories/changelog.txt
index b5bfc06..905a0e9 100644
--- a/script.categories/changelog.txt
+++ b/script.categories/changelog.txt
@@ -23,3 +23,5 @@
- Fixed problem with addons using the "content_type" parameter
- Added setting for showing the number of addons and addon version in title
- Added setting for notifications
+1.0.9 / 2.0.9
+- Fixed not working add-ons
diff --git a/script.categories/default.py b/script.categories/default.py
index 51149f0..5f2bdd0 100644
--- a/script.categories/default.py
+++ b/script.categories/default.py
@@ -117,24 +117,17 @@ def listCat(cat):
if '"Method not found."' in json_result:
if cat == "all":
for a in addons:
- path =
xbmc.translatePath('special://home/addons/'+a+'/addon.xml')
- try:
- fh = open(path, 'r')
- xml = fh.read()
- fh.close()
- match=re.compile('<provides>(.+?)</provides>',
re.DOTALL).findall(xml)
- types=match[0]
- except:
- types=""
+ types = getTypes(a)
if a!="script.categories" and contentType in types:
try:
currentAddon = xbmcaddon.Addon(id=a)
+ addonUrl = getAddonUrl(a,types)
if versionInTitle=="true":
title = currentAddon.getAddonInfo('name')+"
("+currentAddon.getAddonInfo('version')+")"
else:
title = currentAddon.getAddonInfo('name')
desc = "Version: "+currentAddon.getAddonInfo('version')+"
("+currentAddon.getAddonInfo('author')+")\n"+currentAddon.getAddonInfo('description')
-
addAddonDir(title,a,currentAddon.getAddonInfo('icon'),desc,contentType)
+
addAddonDir(title,addonUrl,currentAddon.getAddonInfo('icon'),desc,contentType,a)
except:
pass
else:
@@ -143,24 +136,17 @@ def listCat(cat):
content=fh.read()
fh.close()
for a in addons:
- path =
xbmc.translatePath('special://home/addons/'+a+'/addon.xml')
- try:
- fh = open(path, 'r')
- xml = fh.read()
- fh.close()
- match=re.compile('<provides>(.+?)</provides>',
re.DOTALL).findall(xml)
- types=match[0]
- except:
- types=""
+ types = getTypes(a)
if a!="script.categories" and contentType in types and
a+"#"+cat in content:
try:
currentAddon = xbmcaddon.Addon(id=a)
+ addonUrl = getAddonUrl(a,types)
if versionInTitle=="true":
title = currentAddon.getAddonInfo('name')+"
("+currentAddon.getAddonInfo('version')+")"
else:
title = currentAddon.getAddonInfo('name')
desc = "Version: "+currentAddon.getAddonInfo('version')+"
("+currentAddon.getAddonInfo('author')+")\n"+currentAddon.getAddonInfo('description')
-
addAddonRDir(title,a,currentAddon.getAddonInfo('icon'),cat,desc)
+
addAddonRDir(title,addonUrl,currentAddon.getAddonInfo('icon'),cat,desc,a)
except:
pass
@@ -170,13 +156,15 @@ def listCat(cat):
for addonid, temp in match:
try:
if addonid!="script.categories":
+ types = getTypes(addonid)
+ addonUrl = getAddonUrl(addonid,types)
currentAddon = xbmcaddon.Addon(id=addonid)
if versionInTitle=="true":
title = currentAddon.getAddonInfo('name')+"
("+currentAddon.getAddonInfo('version')+")"
else:
title = currentAddon.getAddonInfo('name')
desc = "Version: "+currentAddon.getAddonInfo('version')+"
("+currentAddon.getAddonInfo('author')+")\n"+currentAddon.getAddonInfo('description')
-
addAddonDir(title,addonid,currentAddon.getAddonInfo('icon'),desc,contentType)
+
addAddonDir(title,addonUrl,currentAddon.getAddonInfo('icon'),desc,contentType,addonid)
except:
pass
else:
@@ -188,19 +176,42 @@ def listCat(cat):
if addonid+"#"+cat in content:
try:
if addonid!="script.categories":
+ types = getTypes(addonid)
+ addonUrl = getAddonUrl(addonid,types)
currentAddon = xbmcaddon.Addon(id=addonid)
if versionInTitle=="true":
title = currentAddon.getAddonInfo('name')+"
("+currentAddon.getAddonInfo('version')+")"
else:
title = currentAddon.getAddonInfo('name')
desc = "Version:
"+currentAddon.getAddonInfo('version')+"
("+currentAddon.getAddonInfo('author')+")\n"+currentAddon.getAddonInfo('description')
-
addAddonRDir(title,addonid,currentAddon.getAddonInfo('icon'),cat,desc)
+
addAddonRDir(title,addonUrl,currentAddon.getAddonInfo('icon'),cat,desc,addonid)
except:
pass
xbmcplugin.endOfDirectory(pluginhandle)
if forceViewMode=="true":
xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
+def getTypes(addonId):
+ path =
xbmc.translatePath('special://home/addons/'+addonId+'/addon.xml')
+ try:
+ fh = open(path, 'r')
+ xml = fh.read()
+ fh.close()
+ match=re.compile('<provides>(.+?)</provides>',
re.DOTALL).findall(xml)
+ types=match[0]
+ except:
+ types=""
+ return types
+
+def getAddonUrl(addonId,types):
+ pluginType="plugin"
+ if addonId.startswith("script.") and addonId!="script.simpleplaylists":
+ pluginType="script"
+ addonUrl=pluginType+"://"+addonId
+ if " " in types:
+ addonUrl=pluginType+"://"+addonId+"/?content_type="+contentType
+ return addonUrl
+
def addAddon(args):
cType=args[:args.find("#")]
addonID=args[args.find("#")+1:]
@@ -311,15 +322,6 @@ def parameters_string_to_dict(parameters):
paramDict[paramSplits[0]] = paramSplits[1]
return paramDict
-def addLink(name,url,mode,iconimage,desc="",duration=""):
-
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&content_type="+str(contentType)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png",
thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": desc,
"Duration": duration } )
- liz.setProperty('IsPlayable', 'true')
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz)
- return ok
-
def addDir(name,url,mode,iconimage):
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&content_type="+str(contentType)
ok=True
@@ -328,20 +330,20 @@ def addDir(name,url,mode,iconimage):
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
-def addAddonDir(name,url,iconimage,desc="",cType=""):
+def addAddonDir(name,url,iconimage,desc,cType,id):
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": desc } )
- liz.addContextMenuItems([(translation(30002),
'RunPlugin(plugin://script.categories/?mode=addAddon&url='+urllib.quote_plus(cType+"#"+url)+')',)])
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url="plugin://"+url+"/?content_type="+contentType,listitem=liz,isFolder=True)
+ liz.addContextMenuItems([(translation(30002),
'RunPlugin(plugin://script.categories/?mode=addAddon&url='+urllib.quote_plus(cType+"#"+id)+')',)])
+
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
return ok
-def addAddonRDir(name,url,iconimage,cat,desc=""):
+def addAddonRDir(name,url,iconimage,cat,desc,id):
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": desc } )
- liz.addContextMenuItems([(translation(30003),
'RunPlugin(plugin://script.categories/?mode=deleteAddon&url='+urllib.quote_plus(url+"#"+cat+"#END")+')',)])
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url="plugin://"+url+"/?content_type="+contentType,listitem=liz,isFolder=True)
+ liz.addContextMenuItems([(translation(30003),
'RunPlugin(plugin://script.categories/?mode=deleteAddon&url='+urllib.quote_plus(id+"#"+cat+"#END")+')',)])
+
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
return ok
def addRDir(name,url,mode,iconimage):
-----------------------------------------------------------------------
Summary of changes:
script.categories/addon.xml | 10 ++++--
script.categories/changelog.txt | 2 +
script.categories/default.py | 76 ++++++++++++++++++++-------------------
3 files changed, 48 insertions(+), 40 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons