EmuELEC / EmuELEC-Addon

33 stars 18 forks source link

How to create a new EmuELEC-Addon for coreelec20? #8

Closed zcmi closed 1 year ago

zcmi commented 1 year ago

I want to create the new version ,but this scripts latest update on 2 years ago。this Releases can only work on coreelec 19.x

HATT0R1HANZ0 commented 1 year ago

Hi @zcmi

The Releases (Kodi 19) from Maskedeken works also on Kodi20. But you have to modify the two Python files (default and util) from the Script.

The xbmc.translatePath command no longer exists on kodi 20 and must be replaced with xbmcvfs.translatePath.

File default.py:

import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon import os import util

dialog = xbmcgui.Dialog() dialog.notification('EmuELEC', 'Launching....', xbmcgui.NOTIFICATION_INFO, 5000)

ADDON_ID = 'script.emuelec.Amlogic-ng.launcher'

addon = xbmcaddon.Addon(id=ADDON_ID) addon_dir = xbmcvfs.translatePath( addon.getAddonInfo('path') ) addonfolder = addon.getAddonInfo('path')

icon = addonfolder + 'resources/icon.png' fanart = addonfolder + 'resources/fanart.png'

util.runRetroarchMenu()

File util.py:

import os, xbmc, xbmcvfs, xbmcaddon

ADDON_ID = 'script.emuelec.Amlogic-ng.launcher' BIN_FOLDER="bin" RETROARCH_EXEC="emuelec.sh"

addon = xbmcaddon.Addon(id=ADDON_ID)

def runRetroarchMenu(): addon_dir = xbmcvfs.translatePath( addon.getAddonInfo('path') ) bin_folder = os.path.join(addon_dir,BIN_FOLDER) retroarch_exe = os.path.join(bin_folder,RETROARCH_EXEC) os.system(retroarch_exe)

Greetings

zcmi commented 1 year ago

it seems to be something else wrong with this,can't start

this is log: https://zcmi.lanzoue.com/iui4W0w0gzaj

i use this package https://github.com/Damenly/coreelec

HATT0R1HANZ0 commented 1 year ago

I tested it again and it works for me. Did you also add xbmcvfs to the script import?

File default.py:

import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon

File util.py:

import os, xbmc, xbmcvfs, xbmcaddon

Attached are the two files you need to exchange:

https://filetransfer.io/data-package/iMKN75ci#link

zcmi commented 1 year ago

I tested it again and it works for me. Did you also add xbmcvfs to the script import?

File default.py:

import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon

File util.py:

import os, xbmc, xbmcvfs, xbmcaddon

Attached are the two files you need to exchange:

https://filetransfer.io/data-package/iMKN75ci#link

thank you ,it can start

meeuuh92 commented 9 months ago

Thank you. It works !