From dc830324aeda6af7dc33aed4b7e5193aeffae8ab Mon Sep 17 00:00:00 2001 From: Shatil Rafiullah Date: Wed, 13 Nov 2013 21:50:43 -0800 Subject: [PATCH] Added XBMC collection (set) categorization capability. --- couchpotato/core/providers/info/themoviedb/main.py | 1 + couchpotato/core/providers/metadata/xbmc/main.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/couchpotato/core/providers/info/themoviedb/main.py b/couchpotato/core/providers/info/themoviedb/main.py index 87579a0c..c9f9763b 100644 --- a/couchpotato/core/providers/info/themoviedb/main.py +++ b/couchpotato/core/providers/info/themoviedb/main.py @@ -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) diff --git a/couchpotato/core/providers/metadata/xbmc/main.py b/couchpotato/core/providers/metadata/xbmc/main.py index e865e2d4..857e5e5c 100644 --- a/couchpotato/core/providers/metadata/xbmc/main.py +++ b/couchpotato/core/providers/metadata/xbmc/main.py @@ -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))