From 6a0b9a4934718521611ac4ac8381b3bdbb6e6414 Mon Sep 17 00:00:00 2001 From: xnappo Date: Thu, 28 May 2015 09:57:15 -0500 Subject: [PATCH] Fix info for direct play with password on network --- addon.xml | 2 +- resources/lib/WriteKodiVideoDB.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 1fd3a2b2..d2cf4ae6 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/WriteKodiVideoDB.py b/resources/lib/WriteKodiVideoDB.py index 38e72b4e..26e9cd30 100644 --- a/resources/lib/WriteKodiVideoDB.py +++ b/resources/lib/WriteKodiVideoDB.py @@ -458,7 +458,13 @@ class WriteKodiVideoDB(): #create toplevel path as monitored source - needed for things like actors and stuff to work (no clue why) if addon.getSetting('useDirectPaths')=='true': - playurl = MBitem["Path"].replace("\\\\", "smb://").replace("\\", "/") + smbuser = addon.getSetting('smbusername') + smbpass = addon.getSetting('smbpassword') + # Network share + if smbuser: + playurl = MBitem["Path"].replace("\\\\", "smb://%s:%s@" % (smbuser, smbpass)).replace("\\", "/") + else: + playurl = MBitem["Path"].replace("\\\\", "smb://").replace("\\", "/") #make sure that the path always ends with a slash path = utils.convertEncoding(playurl + "/") toplevelpathstr = path.rsplit("/",2)[1]