mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix network creds
Convert backslash to ; for domain\username
This commit is contained in:
parent
37a7ea47d7
commit
299a0bd8f9
1 changed files with 4 additions and 3 deletions
|
@ -320,19 +320,20 @@ def passwordsXML():
|
||||||
for path in root.findall('.//path'):
|
for path in root.findall('.//path'):
|
||||||
if path.find('.//from').text.lower() == "smb://%s/" % server.lower():
|
if path.find('.//from').text.lower() == "smb://%s/" % server.lower():
|
||||||
# Found the server, rewrite credentials
|
# Found the server, rewrite credentials
|
||||||
path.find('.//to').text = "smb://%s:%s@%s/" % (user, password, server)
|
topath = "smb://%s:%s@%s/" % (user, password, server)
|
||||||
|
path.find('.//to').text = topath.replace("\\", ";")
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# Server not found, add it.
|
# Server not found, add it.
|
||||||
path = etree.SubElement(root, 'path')
|
path = etree.SubElement(root, 'path')
|
||||||
etree.SubElement(path, 'from', attrib={'pathversion': "1"}).text = "smb://%s/" % server
|
etree.SubElement(path, 'from', attrib={'pathversion': "1"}).text = "smb://%s/" % server
|
||||||
topath = "smb://%s:%s@%s/" % (user, password, server)
|
topath = "smb://%s:%s@%s/" % (user, password, server)
|
||||||
etree.SubElement(path, 'to', attrib={'pathversion': "1"}).text = topath
|
etree.SubElement(path, 'to', attrib={'pathversion': "1"}).text = topath.replace("\\", ";")
|
||||||
# Force Kodi to see the credentials without restarting
|
# Force Kodi to see the credentials without restarting
|
||||||
xbmcvfs.exists(topath)
|
xbmcvfs.exists(topath)
|
||||||
|
|
||||||
# Add credentials
|
# Add credentials
|
||||||
settings('networkCreds', value="%s" % server)
|
settings('networkCreds', value=server)
|
||||||
log.info("Added server: %s to passwords.xml" % server)
|
log.info("Added server: %s to passwords.xml" % server)
|
||||||
# Prettify and write to file
|
# Prettify and write to file
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue