Notice to addon devs
#16
Use of string ID inside add-ons

It seems we haven't been to paying enough attention to which string IDs add-ons use. So for new add-ons will be paying more close attention and ask the authors to stay within the defined range before accepting.
  • strings 30000 thru 30999 reserved for plugins and plugin settings
  • strings 31000 thru 31999 reserved for skins
  • strings 32000 thru 32999 reserved for scripts
  • strings 33000 thru 33999 reserved for common strings used in add-ons

For add-ons already available we would like to ask kindly if possible to update the usage of the used string IDs within these defined ranges (or at least anywhere between 30000 and 33999)
If you you already have your add-on added to transifex it should be possible to transfer current translations to the new range.

Here's current list of add-ons in repo that are outside the defined range:
http://pastebin.com/rAsnf66X

Note:
If you are using skin xml files that may also be shipped within skins you need temporary keep the old ID to prevent breaking current skins that still have the xml files with the old ids. Just having the English ones should suffice. After this request the skinner to update the files accordingly.
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
#17
Is there a price for being on these lists every time? Smile

Quote:If you you already have your add-on added to transifex it should be possible to transfer current translations to the new range.
How would I do this? Just upload the new string.xml with new ids?

Quote:If you are using skin xml files that may also be shipped within skins you need temporary keep the old ID to prevent breaking current skins that still have the xml files with the old ids.
So I will have both ids in the string.xml (old and new) until all skins are updated?
Reply
#18
(2013-09-29, 18:04)Martijn Wrote: Do not use os.getcwd()
This is the list of add-ons that are still using it:
Quote:service.watchdog
Should only be used in a script bundled with one of libraries (watchmedo.py). Never called in the addon. Could remove the file..
Reply
#19
(2013-10-09, 13:00)takoi Wrote:
(2013-09-29, 18:04)Martijn Wrote: Do not use os.getcwd()
This is the list of add-ons that are still using it:
Quote:service.watchdog
Should only be used in a script bundled with one of libraries (watchmedo.py). Never called in the addon. Could remove the file..

shouldn't be a problem to leave it there
reason is that os.getcwd() could report the wrong folder when used inside XBMC.
i just did grep for that command. didn't look if it was actually used Smile
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
#20
Yeah, I understand the issue and figured that's what you did, grep for it, so I'm just letting you know it isn't usedSmile
Reply
#21
(2013-10-07, 17:49)malte Wrote: Is there a price for being on these lists every time? Smile

Quote:If you you already have your add-on added to transifex it should be possible to transfer current translations to the new range.
How would I do this? Just upload the new string.xml with new ids?

Quote:If you are using skin xml files that may also be shipped within skins you need temporary keep the old ID to prevent breaking current skins that still have the xml files with the old ids.
So I will have both ids in the string.xml (old and new) until all skins are updated?
sorry for late response.
indeed just duplicate the strings, Transifex will pick them up once synced and as it has translation memory it shouldn't be to much effort on the translators side to adapt to these.
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
#22
(2013-09-19, 22:44)Martijn Wrote: script.module.simplejson
It seems that from python 2.7 and up the internal JSON lib is faster than the external script.module.simplejson that most of us use.
To test this out for yourself you can download script.json.performance-0.0.1.zip and try it out for yourself what the difference is.
Note: running the addon gives no indication during it's testing so have some patience until the dialog pops up.
Since some platforms use 2.6 you can use the following code to use the fastest method:
PHP Code:
if sys.version_info >=  (27):
    
import _json
else:
    
import simplejson as _json 

I'm having issues with this and it seems to be platform specific

I recently switched my script.module.metahandlers addon to use this method and when trying to load the json object returned from TMDB I receive an error that the 'loads' object does not exist:

Code:
12:48:49 T:2747266144   DEBUG: metahandler: Requesting TMDB : http://api.themoviedb.org/3/movie/tt1961680?language=en&api_key=b91e899ce561dd19695340c3b26e0a02&
12:48:49 T:2747266144   ERROR: metahandler: Error connecting to TMDB: 'module' object has no attribute 'loads'

Here's what I'm doing in code:

Code:
meta = simplejson.loads(net.http_GET(url,{"Accept":"application/json"}).content)

Basically net.http_GET() is a quick function that does an http request, this has always worked previously

So far this has been reported on OpenElec and Raspbmc installs, Windows and iOS have been verified as working fine, all running Frodo 12.2
Reply
#23
(2013-11-04, 00:41)Eldorado Wrote:
Code:
12:48:49 T:2747266144   DEBUG: metahandler: Requesting TMDB : http://api.themoviedb.org/3/movie/tt1961680?language=en&api_key=b91e899ce561dd19695340c3b26e0a02&
12:48:49 T:2747266144   ERROR: metahandler: Error connecting to TMDB: 'module' object has no attribute 'loads'

i've seen that issue before.
if you encounter this error, you most likely have some third party addon installed that includes
either a json.py or simplejson.py module.


edit: see
http://forum.xbmc.org/showthread.php?tid=151806
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#24
Ah... thanks ronie!

I think for now I'll just go back to the old method of using simplejson.. a bit annoying when people include common libs in their addons
Reply
#25
I had a json.py file I wrote myself. Same issue. Also don't import json as json but call it something else.
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
#26
This is what I'm using atm:

Code:
import _json
if not 'load' in dir(_json):
    import simplejson as _json
Reply
#27
@Martijn,

In the Pandora addon (@ https://github.com/rivy/xbmc-pandora ), I'm currently forced to use:

PHP Code:
xbmc.Playerxbmc.PLAYER_CORE_MPLAYER ).playurlitem 

The audio stream URLs returned from Pandora are in .mp3 and .mp4 formats. And, in Frodo and the current monthly release of Gotham, leaving the xbmc.Player() to the default/AUTO logic causes a codec search failure (though only for the .mp4's):

Quote:19:05:15 T:10484 NOTICE: PANDORA: Item 0 http://audio-dc6-t1-3.pandora.com/access...3Paw%3D%3D
19:05:15 T:10484 NOTICE: PANDORA: Item 1 <xbmcgui.ListItem object at 0x1020B290>
19:05:16 T:11056 ERROR: CAudioDecoder: Unable to Init Codec while loading file http://audio-dc6-t1-3.pandora.com/access...3Paw%3D%3D

Is this a bug in the xbmc.Player()?

Or will there be some other method to push the Player() toward an audio codec search in Gotham?

Where should I go from this to avoid breaking the plugin when Gotham is released?

Thanks.
Reply
#28
Sounds like a bug as it should detect what the mp4 actually is and play it as a music stream

please create a ticket on trac.xbmc.org and provide ways on how to reproduce (addon / stream and so on)

the logic for now won t be removed but about 99$ of the addons used it without it being actually needed. in your case it seems still needed due to some reason.
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
#29
In the mean time I wonder if you might be able to bypass it by manually specifying a mime type on the listitem
Reply
#30
@Martijn,

I've posted a trac bug @ http://trac.xbmc.org/ticket/14854

@Bstrdsmkr,

Thanks for the suggestion. I'll try that idea.
Reply

Logout Mark Read Team Forum Stats Members Help
Notice to addon devs3