mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Give xml files correct attributes
This commit is contained in:
parent
3788a0b79c
commit
3e1884176d
1 changed files with 6 additions and 4 deletions
|
@ -387,10 +387,8 @@ class Views(object):
|
||||||
xml = etree.parse(file).getroot()
|
xml = etree.parse(file).getroot()
|
||||||
xml.set('order', str(index))
|
xml.set('order', str(index))
|
||||||
else:
|
else:
|
||||||
xml = self.node_root('filter', index)
|
xml = self.node_root('main', index)
|
||||||
etree.SubElement(xml, 'label')
|
etree.SubElement(xml, 'label')
|
||||||
etree.SubElement(xml, 'match')
|
|
||||||
etree.SubElement(xml, 'content')
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
LOG.exception(error)
|
LOG.exception(error)
|
||||||
xml = self.node_root('main', index)
|
xml = self.node_root('main', index)
|
||||||
|
@ -470,7 +468,7 @@ class Views(object):
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
xml = etree.parse(file).getroot()
|
xml = etree.parse(file).getroot()
|
||||||
else:
|
else:
|
||||||
xml = self.node_root('filter', index)
|
xml = self.node_root('folder', index)
|
||||||
etree.SubElement(xml, 'label')
|
etree.SubElement(xml, 'label')
|
||||||
etree.SubElement(xml, 'content')
|
etree.SubElement(xml, 'content')
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -479,6 +477,10 @@ class Views(object):
|
||||||
etree.SubElement(xml, 'label')
|
etree.SubElement(xml, 'label')
|
||||||
etree.SubElement(xml, 'content')
|
etree.SubElement(xml, 'content')
|
||||||
|
|
||||||
|
# Migration for https://github.com/jellyfin/jellyfin-kodi/issues/239
|
||||||
|
if xml.attrib.get('type') == 'filter':
|
||||||
|
xml.attrib = {'type': 'folder', 'order': '5'}
|
||||||
|
|
||||||
label = xml.find('label')
|
label = xml.find('label')
|
||||||
label.text = name
|
label.text = name
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue