Solved Python error in qobuz plugin
#1
Hi,

Not sure if this is the correct forum for this question, please redirect if necessary. I am running kodi v19 nightly on ubuntu 16.04, updated very regularly. Since 2-3 days ago qobuz plugin stopped loading, throwing an error. Python trace would differ depending on the version of plugin I tried, but basically it boils down to KeyError exception triggered by the following function:

python:
def lang(langId):
    s = config.app.addon.getLocalizedString(langId)
    if not s:
        raise KeyError(langId)
    return s

langId parameter is basically an index into a xml schema resources/language/English/strings.xml and this is not caused by issues such as non-existent indexes etc. Qobuz plugin has not been modified for at least 1 year. I tried the official plugin 1.2.3 and dev version 1.3.3 and it is essentially the same error. If I revert kodi version to git20190520 everything starts working fine. So it is clearly some update to getLocalizedString causing this.

Could somebody please help with an explanation? Is it due to this commit https://github.com/xbmc/xbmc/pull/16119 ? If it is, could you please provide a pointer how the function above should be modified? qobuz plugin seems orphaned, but I could go and create a fork.

Thanks!
-- Stanislav
Reply
#2
(2019-05-26, 16:20)Stanislav Wrote: Hi,

Not sure if this is the correct forum for this question, please redirect if necessary. I am running kodi v19 nightly on ubuntu 16.04, updated very regularly. Since 2-3 days ago qobuz plugin stopped loading, throwing an error. Python trace would differ depending on the version of plugin I tried, but basically it boils down to KeyError exception triggered by the following function:

python:
def lang(langId):
    s = config.app.addon.getLocalizedString(langId)
    if not s:
        raise KeyError(langId)
    return s

langId parameter is basically an index into a xml schema resources/language/English/strings.xml and this is not caused by issues such as non-existent indexes etc. Qobuz plugin has not been modified for at least 1 year. I tried the official plugin 1.2.3 and dev version 1.3.3 and it is essentially the same error. If I revert kodi version to git20190520 everything starts working fine. So it is clearly some update to getLocalizedString causing this.

Could somebody please help with an explanation? Is it due to this commit https://github.com/xbmc/xbmc/pull/16119 ? If it is, could you please provide a pointer how the function above should be modified? qobuz plugin seems orphaned, but I could go and create a fork.

Thanks!
-- Stanislav

Yes strings.xml support was removed, it was deprecated for ages.
The addon author should update the addon to use .po files , see https://kodi.wiki/view/Add-on_structure#...anguage.2F
You shouldn't attempt to "fix" the function but to convert the addon to use supported localization, see the link above, there are tools which can convert strings.xml to .po.
Reply
#3
Thanks, I confirm that things are fine after I convert add-on's strings.xml to strings.po. I will report the issue to plugin creators, but the project seems abandoned.
Reply
#4
Hello Stanislav,
does this affect the login process in the qobuz addon? I would like to use it but can not login (double checked several times, using mail address and username...).
Could you perhaps send me the .po file you compiled? That would be really great!
Thank you!
Regards
Wolfram/Germany
Reply
#5
Sorry, I uninstalled the plugin as I moved to a dedicated network streamer and I don't have this file backed up.

From memory, login process was not affected by this issue.
Reply
#6
What a pity... Thank you for answering!
Reply

Logout Mark Read Team Forum Stats Members Help
Python error in qobuz plugin0