Set default companion name to PlexKodiConnect

This commit is contained in:
tomkat83 2017-03-05 15:30:06 +01:00
parent f974e1a202
commit 25afc0c702
3 changed files with 14 additions and 10 deletions

View file

@ -26,7 +26,7 @@ def getSettings():
options['gdm_debug'] = settings('companionGDMDebugging')
options['gdm_debug'] = True if options['gdm_debug'] == 'true' else False
options['client_name'] = settings('deviceName')
options['client_name'] = v.DEVICENAME
# XBMC web server options
options['webserver_enabled'] = (getGUI('webserver') == "true")

View file

@ -46,13 +46,18 @@ elif xbmc.getCondVisibility('system.platform.android'):
else:
PLATFORM = "Unknown"
if _ADDON.getSetting('deviceNameOpt') == "false":
# Use Kodi's deviceName
DEVICENAME = tryDecode(xbmc.getInfoLabel('System.FriendlyName'))
else:
DEVICENAME = tryDecode(_ADDON.getSetting('deviceName'))
DEVICENAME = DEVICENAME.replace("\"", "_")
DEVICENAME = DEVICENAME.replace("/", "_")
DEVICENAME = DEVICENAME.replace(":", "")
DEVICENAME = DEVICENAME.replace("/", "-")
DEVICENAME = DEVICENAME.replace("\\", "-")
DEVICENAME = DEVICENAME.replace("<", "")
DEVICENAME = DEVICENAME.replace(">", "")
DEVICENAME = DEVICENAME.replace("*", "")
DEVICENAME = DEVICENAME.replace("?", "")
DEVICENAME = DEVICENAME.replace('|', "")
DEVICENAME = DEVICENAME.replace('(', "")
DEVICENAME = DEVICENAME.replace(')', "")
DEVICENAME = DEVICENAME.strip()
# Database paths
_DB_VIDEO_VERSION = {

View file

@ -36,8 +36,7 @@
<setting type="lsep" label="39008" />
<setting id="plexCompanion" label="39004" type="bool" default="true" />
<setting id="deviceNameOpt" label="30504" type="bool" default="false" subsetting="true" visible="eq(-1,true)" />
<setting id="deviceName" label="30016" type="text" visible="eq(-1,true)" default="Kodi" subsetting="true" />
<setting id="deviceName" label="30016" type="text" visible="eq(-1,true)" default="PlexKodiConnect" subsetting="true" />
<setting id="companionPort" label="39005" type="number" default="3005" option="int" visible="eq(-3,true)" subsetting="true" />
<setting id="companionUpdatePort" label="39078" type="number" default="32412" option="int" visible="eq(-4,true)" subsetting="true" />