mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Fix profile masterlock
fix missing content if a master lock is set.
This commit is contained in:
parent
0818e627c1
commit
467c474f4d
1 changed files with 13 additions and 8 deletions
|
@ -36,20 +36,25 @@ def sources():
|
||||||
etree.SubElement(files, 'default', attrib={'pathversion': "1"})
|
etree.SubElement(files, 'default', attrib={'pathversion': "1"})
|
||||||
|
|
||||||
video = xml.find('video')
|
video = xml.find('video')
|
||||||
count = 2
|
count_http = 1
|
||||||
|
count_smb = 1
|
||||||
|
|
||||||
for source in xml.findall('.//path'):
|
for source in xml.findall('.//path'):
|
||||||
if source.text == 'smb://':
|
if source.text == 'smb://':
|
||||||
count -= 1
|
count_smb -= 1
|
||||||
|
elif source.text == 'http://':
|
||||||
|
count_http -= 1
|
||||||
|
|
||||||
if count == 0:
|
if not count_http and not count_smb:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
for i in range(0, count):
|
for protocol in ('smb://', 'http://'):
|
||||||
source = etree.SubElement(video, 'source')
|
if (protocol == 'smb://' and count_smb > 0) or (protocol == 'http://' and count_http > 0):
|
||||||
etree.SubElement(source, 'name').text = "Emby"
|
|
||||||
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = "smb://"
|
source = etree.SubElement(video, 'source')
|
||||||
etree.SubElement(source, 'allowsharing').text = "true"
|
etree.SubElement(source, 'name').text = "Emby"
|
||||||
|
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = protocol
|
||||||
|
etree.SubElement(source, 'allowsharing').text = "true"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
files = xml.find('files')
|
files = xml.find('files')
|
||||||
|
|
Loading…
Reference in a new issue