From 06d00b2a12a65d5fb199ec2ece08a130fb2fdcea Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 6 Nov 2018 13:43:40 +0100 Subject: [PATCH] Use Kodi hostname as Plex Companion friendly name --- resources/lib/variables.py | 3 +++ resources/settings.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 71c08eae..a8ef0e16 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -66,6 +66,9 @@ else: PLATFORM = "Unknown" DEVICENAME = try_decode(_ADDON.getSetting('deviceName')) +if not DEVICENAME: + DEVICENAME = try_decode(xbmc.getInfoLabel('System.FriendlyName')) + _ADDON.setSetting('deviceName', DEVICENAME) DEVICENAME = DEVICENAME.replace(":", "") DEVICENAME = DEVICENAME.replace("/", "-") DEVICENAME = DEVICENAME.replace("\\", "-") diff --git a/resources/settings.xml b/resources/settings.xml index 11fa8bea..95c95f31 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -30,7 +30,7 @@ - +