Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
Hey,
I hope you can help me again: After upgrading to 19 my plugin is no longer 'compatible' ...?... I guess this is because of the change to Python 3 ? Is there a quick fix to get it working again?
Best wishes,
Marc
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
Hi,
thanks for answering so quickly.
I'll have to check how this 2to3.py works, even where to find it...
As for my files - I did send them via email (to the adress that you gave me in december), I do not know if attaching files in the forum is even possible... Let's see if this works, My Emails were blocked back then...
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
OK,
I modified the addon.xml as described.
Then I had 2to3.py modify my addon.py file. At first it did not work because I have some german special characters in there that were not prperly formated; after correcting these I could run 2to3 on the file. Actually I had to run it twice, on the second run it still did some changes.
Now it does not change the file any more, but it still tells me that it needs to be modified:
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No changes to D:\Work\Kodi\script.atumno.videoarchiv\addon.py
RefactoringTool: Files that need to be modified:
RefactoringTool: D:\Work\Kodi\script.atumno.videoarchiv\addon.py
And in Kodi I still get a 'not compatible' error when trying to activate the plugin.
I will mail you the modified files via Email.
Posts: 1,703
Joined: Oct 2015
Reputation:
186
2021-02-23, 17:12
(This post was last modified: 2021-02-23, 17:24 by jbinkley60.)
So my error here. I added an extra .0 in the Python dependency like in your addon.xml file.
It should be:
<import addon="xbmc.python" version="3.0.0"/>
and not:
<import addon="xbmc.python" version="3.0.0.0"/>
With this change it now loads under Kodi 19.
Jeff
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
2021-02-23, 19:36
(This post was last modified: 2021-02-23, 19:53 by vonson.)
If somebody does something similar in his own addon and is interested in how to solve my little problem:
First of all, keep in mind, you'll need to keep 2 separate versions of your addon for Kodi 18 and Kodi 19.
Then, the changes I had to do (for the Kodi 19 version):
In the 'addon.xml' file I had to change
<import addon="xbmc.python" version="2.14.0"/>
to
<import addon="xbmc.python" version="3.0.0"/>
Now you need to run 2to3.py. If you have Python installed, you will find it in there.
On the command line run:
[PathToPython]\Tools\scripts\2to3.py [PathToAddon]\addon.py
This gives you a list of the changes it will have to do.
With the switch -w the changes will be written. So run:
[PathToPython]\Tools\scripts\2to3.py -w [PathToAddon]\addon.py
Even if successful try again. Mine found more changes to be made on the second run, so I'd recommend to try this.
With this the plugin could be activated in Kodi 19, but when opening it I still ran into an error
Error Type: <class 'TypeError'>
Error Contents: 'iconImage' is an invalid keyword argument for this function
So I had to change the lines
li = xbmcgui.ListItem(title, iconImage=image)
li.setArt({'thumb': image, 'poster': image})
to
li = xbmcgui.ListItem(title)
li.setArt({'banner': image, 'poster': image, 'icon': image})
This fixed it.
Maybe somebody else may find this useful.
Posts: 1,703
Joined: Oct 2015
Reputation:
186
Thanks for the update and info. I am glad we were able to get your addon ported to Kodi and you back up and running.
Jeff
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
Hey Jeff,
are you still around? It's been a year now and the addon stopped working.
Quick reminder: I'm accessing a csv File to generate a movie list from it.
When I run the addon from a windows machine it works, but on my fire stick it doesn't, it just displays an empty result.
I'd expect a file/folder permission issue, but i just experimentally granted full read/write permissions to everyone, and it still won't work...
Do you have any idea?
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
Thanks for all the replies. So far I could not resolve anything, but still thanks everyone.
Strangely, on my android tablet it still works, it's only on the firestick that it stopped working...
Posts: 156
Joined: Nov 2019
Reputation:
1
vonson
Senior Member
Posts: 156
yes, it did work on the firestick, but i did not use it for some time, and now it doesn't anymore...
and it is still the same unchanged code from one year ago.
I believe this is the section that reads the file:
separator = "\\"
if CsvFile.find(separator) > 0:
folder = left(CsvFile,CsvFile.rfind(separator))
else:
separator = "/"
if CsvFile.find(separator) > 0:
folder = left(CsvFile,CsvFile.rfind(separator))
read_obj = xbmcvfs.File (CsvFile.encode("utf-8"), 'r')
read_obj = read_obj.read()
csv_reader = csv.reader(read_obj, delimiter='|', skipinitialspace=True)