Added XBMC collection (set) categorization capability.

This commit is contained in:
Shatil Rafiullah
2013-11-13 21:50:43 -08:00
committed by Ruud
parent 3f37fc1e11
commit dc830324ae
2 changed files with 8 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ class TheMovieDb(MovieProvider):
'year': year,
'plot': movie.overview,
'genres': genres,
'collection': movie.collection.name,
}
movie_data = dict((k, v) for k, v in movie_data.iteritems() if v)

View File

@@ -104,6 +104,13 @@ class XBMC(MetaDataBase):
writers = SubElement(nfoxml, 'credits')
writers.text = toUnicode(writer)
# Sets or collections
collection_name = toUnicode(movie_info.get('collection'))
if collection_name:
collection = SubElement(nfoxml, 'set')
collection.text = toUnicode(collection_name)
sorttitle = SubElement(nfoxml, 'sorttitle')
sorttitle.text = '%s %s' % (collection_name, movie_info.get('year'))
# Clean up the xml and return it
nfoxml = xml.dom.minidom.parseString(tostring(nfoxml))