Skip to content

Commit

Permalink
Update addon for latest Kodi versions + add Polish language
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoltePudeleczko committed Jun 3, 2023
1 parent 6ced448 commit ad82f16
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ __pycache__/
# C extensions
*.so

.vscode/

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -128,3 +130,5 @@ dmypy.json

# Pyre type checker
.pyre/

script.kodi.geforcenow.zip
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

Kodi addon for launching NVIDIA GeForce NOW app

Supports the latest Kodi v20.1 (and probably even newer ones)

## Keep in mind
- You have to have official NVIDIA GeForce NOW app installed - you can get it [here](https://www.nvidia.com/en-us/geforce-now/download/)
- Currently only supports Windows
Expand Down
43 changes: 24 additions & 19 deletions script.kodi.geforcenow/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
import os.path
import subprocess

ADDON = xbmcaddon.Addon('script.kodi.geforcenow')
ADDON_ID = ADDON.getAddonInfo('id')
ADDON_NAME = ADDON.getAddonInfo('name')
ADDON_VERSION = ADDON.getAddonInfo('version')
ADDON = xbmcaddon.Addon("script.kodi.geforcenow")
ADDON_ID = ADDON.getAddonInfo("id")
ADDON_NAME = ADDON.getAddonInfo("name")
ADDON_VERSION = ADDON.getAddonInfo("version")
MSG = ADDON.getLocalizedString

useCustomExecutable = ADDON.getSetting('useCustomExecutable')
stopMedia = ADDON.getSetting('stopMedia')
useCustomExecutable = ADDON.getSetting("useCustomExecutable")
stopMedia = ADDON.getSetting("stopMedia")


def log(message, level=xbmc.LOGNOTICE):
def log(message, level=xbmc.LOGINFO):
xbmc.log("[{0}:v{1}] {2}".format(ADDON_ID, ADDON_VERSION, message), level)


Expand Down Expand Up @@ -53,8 +53,8 @@ def stopMediaPlayback():


def execute(executable):
parameters = ''
log('Calling executable: {0} with parameters: {1}'.format(executable,parameters))
parameters = ""
log("Calling executable: {0} with parameters: {1}".format(executable, parameters))

if stopMedia:
stopMediaPlayback()
Expand All @@ -64,28 +64,33 @@ def execute(executable):

log("Starting Addon")

if useCustomExecutable == 'true':
customExecutable = ADDON.getSetting('customExecutable')
if useCustomExecutable == "true":
customExecutable = ADDON.getSetting("customExecutable")
if os.path.isfile(customExecutable):
execute(customExecutable)
else:
log('Executable not found on the custom location provided by user', xbmc.LOGERROR)
log(
"Executable not found on the custom location provided by user",
xbmc.LOGERROR,
)
showCustomExecutableNotFoundDialog()

else:
executable = ''
executableTemp = ''
executable = ""
executableTemp = ""

if platform.system() == 'Windows':
executableTemp = os.path.expandvars(r'%LOCALAPPDATA%\NVIDIA Corporation\GeForceNOW\CEF\GeForceNOW.exe')
if platform.system() == "Windows":
executableTemp = os.path.expandvars(
r"%LOCALAPPDATA%\NVIDIA Corporation\GeForceNOW\CEF\GeForceNOW.exe"
)
if os.path.isfile(executableTemp):
executable = executableTemp
else:
log('Windows executable not found on default paths', xbmc.LOGERROR)
log("Windows executable not found on default paths", xbmc.LOGERROR)
showExecutableNotFoundDialog()
if executable:
execute(executable)

else:
log('Platforms other than Windows are not supported now', xbmc.LOGERROR)
showWindowsNotDetected()
log("Platforms other than Windows are not supported now", xbmc.LOGERROR)
showWindowsNotDetected()
23 changes: 14 additions & 9 deletions script.kodi.geforcenow/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.kodi.geforcenow" name="GeForce NOW" version="1.2.0" provider-name="GanzeVA">
<addon id="script.kodi.geforcenow" name="GeForce NOW" version="2.0.0"
provider-name="ZoltePudeleczko">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="xbmc.python" version="3.0.0" />
</requires>
<extension point="xbmc.python.script" library="addon.py">
<provides>executable</provides>
Expand All @@ -10,16 +11,20 @@
<platform>windx</platform>
<summary lang="en">Kodi Addon for launching GeForce NOW</summary>
<description lang="en">Kodi Addon for launching NVIDIA GeForce NOW app.</description>
<summary lang="pl">Wtyczka do odpalania GeForce NOW</summary>
<description lang="pl">Wtyczka do odpalania aplikacji NVIDIA GeForce NOW.</description>
<license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
<language>en</language>
<source>https://github.com/GanzeVA/Kodi-GeForceNOW</source>
<website>https://github.com/GanzeVA/Kodi-GeForceNOW</website>
<forum></forum>
<email>szymonosis@o2.pl</email>
<news></news>
<news>v.2.0 (2023-06-03)
- Assure support with latest Kodi versions (bump xbmc.python libary)
- Add Polish language translation
- Clean-up addon information, update repository url
</news>
<source>https://github.com/ZoltePudeleczko/Kodi-GeForceNOW</source>
<website>https://github.com/ZoltePudeleczko/Kodi-GeForceNOW</website>
<email>szzborowski@gmail.com</email>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
</extension>
</addon>
</addon>
7 changes: 6 additions & 1 deletion script.kodi.geforcenow/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v.2.0
- Assure support with latest Kodi versions (bump xbmc.python libary)
- Add Polish language translation :poland:
- Clean-up addon information, update repository url

v.1.2
- Rewrite changelog to markdown file
- Update language file
Expand All @@ -13,4 +18,4 @@ v.1.0
- English language provided
- Addon finds NVIDIA GeForce NOW in it's default location if installed
- Automatically stops any playback from Kodi
- In settings user can input a custom location
- In settings user can input a custom location
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Kodi Media Center language file
# Addon Name: Kodi GeForceNOW
# Addon id: script.kodi.geforcenow
# Addon Provider: Szymon Zborowski <szymonosis@o2.pl>
# Addon Provider: Szymon Zborowski <szzborowski@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: script.kodi.geforcenow\n"
"Report-Msgid-Bugs-To: szymonosis@o2.pl\n"
"Report-Msgid-Bugs-To: szzborowski@gmail.com\n"
"POT-Creation-Date: 2020-03-02 15:30-0600\n"
"PO-Revision-Date: 2020-03-02 15:30-0600\n"
"Last-Translator: Szymon Zborowski <szymonosis@o2.pl>\n"
"Language-Team: English <szymonosis@o2.pl>\n"
"PO-Revision-Date: 2023-06-03 15:14-0600\n"
"Last-Translator: Szymon Zborowski <szzborowski@gmail.com>\n"
"Language-Team: English <szzborowski@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -29,7 +29,7 @@ msgid "Executable not found"
msgstr ""

msgctxt "#32004"
msgid "The NVIDIA GeForceNOW executable was not found on your System on the expected locations."
msgid "The NVIDIA GeForceNOW executable was not found on your System in the expected locations."
msgstr ""

msgctxt "#32005"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Kodi Media Center language file
# Addon Name: Kodi GeForceNOW
# Addon id: script.kodi.geforcenow
# Addon Provider: Szymon Zborowski <szzborowski@gmail.com>
msgid ""
msgstr ""
"Project-Id-Version: script.kodi.geforcenow\n"
"Report-Msgid-Bugs-To: szzborowski@gmail.com\n"
"POT-Creation-Date: 2020-03-02 15:30-0600\n"
"PO-Revision-Date: 2023-06-03 15:14-0600\n"
"Last-Translator: Szymon Zborowski <szzborowski@gmail.com>\n"
"Language-Team: Polish <szzborowski@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);f\n"

msgctxt "#32001"
msgid "Use custom executable:"
msgstr "Użyj innego pliku .exe:"

msgctxt "#32002"
msgid "Custom Executable:"
msgstr "Ścieżka:"

msgctxt "#32003"
msgid "Executable not found"
msgstr "Nie znaleziono pliku .exe"

msgctxt "#32004"
msgid "The NVIDIA GeForceNOW executable was not found on your System in the expected locations."
msgstr "Nie znaleziono zainstalowanego NVIDIA GeForceNOW na komputerze."

msgctxt "#32005"
msgid "Addon Settings"
msgstr "Ustawienia Wtyczki"

msgctxt "#32006"
msgid "Would you like to open the Addon Settings and specify the NVIDIA GeForceNOW location?"
msgstr "Czy chcesz otworzyć ustawienia wtyczki i wybrać lokalizację NVIDIA GeForceNOW?"

msgctxt "#32007"
msgid "Windows Not Detected"
msgstr "Zły system operacyjny"

msgctxt "#32008"
msgid "This Addon currently works only on Windows platforms."
msgstr "Ta wtyczka działa w tym momencie tylko na platformie Windows."

msgctxt "#32009"
msgid "Custom executable not found"
msgstr "Nie znaleziono podanego pliku .exe"

msgctxt "#32010"
msgid "The custom executable was not found. Please select a new location for it on the Addon Settings."
msgstr "Nie znaleziono podanego pliku .exe. Proszę wybrać nową lokalizację w ustawieniach wtyczki."

msgctxt "#32011"
msgid "Stop all media playback on start"
msgstr "Zatrzymaj wszystkie odtwarzane media przy starcie"
11 changes: 6 additions & 5 deletions script.kodi.geforcenow/resources/settings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="32000">
<setting id="stopMedia" label="32011" type="bool" default="true"/>
<setting id="useCustomExecutable" label="32001" type="bool" default="false"/>
<setting id="customExecutable" label="32002" type="executable" default="" subsetting="true" enable="eq(-1,true)"/>
<category label="32005">
<setting id="stopMedia" label="32011" type="bool" default="true" />
<setting id="useCustomExecutable" label="32001" type="bool" default="false" />
<setting id="customExecutable" label="32002" type="executable" default="" subsetting="true"
enable="eq(-1,true)" />
</category>
</settings>
</settings>

0 comments on commit ad82f16

Please sign in to comment.