[Metadata][XBMC] Add trailer to nfo
This commit is contained in:
1 parent
a466cbcf16
commit
2c1c57333c
1 file changed
+12
@@ -112,6 +112,18 @@ class XBMC(MetaDataBase):
|
|||||||
sorttitle = SubElement(nfoxml, 'sorttitle')
|
sorttitle = SubElement(nfoxml, 'sorttitle')
|
||||||
sorttitle.text = '%s %s' % (toUnicode(collection_name), movie_info.get('year'))
|
sorttitle.text = '%s %s' % (toUnicode(collection_name), movie_info.get('year'))
|
||||||
|
|
||||||
|
# Add trailer if found
|
||||||
|
trailer_found = False
|
||||||
|
if data.get('renamed_files'):
|
||||||
|
for filename in data.get('renamed_files'):
|
||||||
|
if 'trailer' in filename:
|
||||||
|
trailer = SubElement(nfoxml, 'trailer')
|
||||||
|
trailer.text = toUnicode(filename)
|
||||||
|
trailer_found = True
|
||||||
|
if not trailer_found and data['files'].get('trailer'):
|
||||||
|
trailer = SubElement(nfoxml, 'trailer')
|
||||||
|
trailer.text = toUnicode(data['files']['trailer'][0])
|
||||||
|
|
||||||
# Clean up the xml and return it
|
# Clean up the xml and return it
|
||||||
nfoxml = xml.dom.minidom.parseString(tostring(nfoxml))
|
nfoxml = xml.dom.minidom.parseString(tostring(nfoxml))
|
||||||
xml_string = nfoxml.toprettyxml(indent = ' ')
|
xml_string = nfoxml.toprettyxml(indent = ' ')
|
||||||
|
|||||||
Reference in new issue
Block a user