From 778dd43b3f17220db9bf1201a976a101b5825dcb Mon Sep 17 00:00:00 2001
From: Matt <mcarlton00@gmail.com>
Date: Mon, 8 Mar 2021 20:12:52 -0500
Subject: [PATCH] Stop editing sources.xml

---
 jellyfin_kodi/full_sync.py   |  2 --
 jellyfin_kodi/helper/xmls.py | 61 ------------------------------------
 2 files changed, 63 deletions(-)

diff --git a/jellyfin_kodi/full_sync.py b/jellyfin_kodi/full_sync.py
index 36ceb64b..1a703ff1 100644
--- a/jellyfin_kodi/full_sync.py
+++ b/jellyfin_kodi/full_sync.py
@@ -95,8 +95,6 @@ class FullSync(object):
         else:
             self.mapping()
 
-        xmls.sources()
-
         if not xmls.advanced_settings() and self.sync['Libraries']:
             self.start()
 
diff --git a/jellyfin_kodi/helper/xmls.py b/jellyfin_kodi/helper/xmls.py
index d19a7c20..921865bf 100644
--- a/jellyfin_kodi/helper/xmls.py
+++ b/jellyfin_kodi/helper/xmls.py
@@ -19,67 +19,6 @@ LOG = LazyLogger(__name__)
 #################################################################################################
 
 
-def sources():
-
-    ''' Create master lock compatible sources.
-        Also add the kodi.jellyfin.media source.
-    '''
-    path = xbmc.translatePath("special://profile/")
-    file = os.path.join(path, 'sources.xml')
-
-    try:
-        xml = etree.parse(file).getroot()
-    except Exception:
-
-        xml = etree.Element('sources')
-        video = etree.SubElement(xml, 'video')
-        files = etree.SubElement(xml, 'files')
-        etree.SubElement(video, 'default', attrib={'pathversion': "1"})
-        etree.SubElement(files, 'default', attrib={'pathversion': "1"})
-
-    video = xml.find('video')
-    count_http = 1
-    count_smb = 1
-
-    for source in xml.findall('.//path'):
-        if source.text == 'smb://':
-            count_smb -= 1
-        elif source.text == 'http://':
-            count_http -= 1
-
-        if not count_http and not count_smb:
-            break
-    else:
-        for protocol in ('smb://', 'http://'):
-            if (protocol == 'smb://' and count_smb > 0) or (protocol == 'http://' and count_http > 0):
-
-                source = etree.SubElement(video, 'source')
-                etree.SubElement(source, 'name').text = "Jellyfin"
-                etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = protocol
-                etree.SubElement(source, 'allowsharing').text = "true"
-
-    try:
-        files = xml.find('files')
-
-        if files is None:
-            files = etree.SubElement(xml, 'files')
-
-        for source in xml.findall('.//path'):
-            # TODO get a repo url
-            if source.text == 'http://kodi.jellyfin.media':
-                break
-        else:
-            source = etree.SubElement(files, 'source')
-            etree.SubElement(source, 'name').text = "kodi.jellyfin.media"
-            etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = "http://kodi.jellyfin.media"
-            etree.SubElement(source, 'allowsharing').text = "true"
-    except Exception as error:
-        LOG.exception(error)
-
-    tree = etree.ElementTree(xml)
-    tree.write(file)
-
-
 def tvtunes_nfo(path, urls):
 
     ''' Create tvtunes.nfo