]> git.pld-linux.org Git - packages/griffith.git/commitdiff
import cast field
authorElan Ruusamäe <glen@delfi.ee>
Tue, 28 Jul 2015 17:23:56 +0000 (20:23 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 28 Jul 2015 17:23:56 +0000 (20:23 +0300)
Kodi.py

diff --git a/Kodi.py b/Kodi.py
index 2242f3e5c3165237e8093d0dc78e76c0278b5796..585f16e1556c5bfb7414312922184387e642ab06 100644 (file)
--- a/Kodi.py
+++ b/Kodi.py
@@ -62,7 +62,7 @@ class ImportPlugin(IP):
         'title': 'title',
         'o_title': 'originaltitle',
         'year': 'year',
-        'runtime': 'runtime', # may need int cast
+        'runtime': 'runtime',
         'rating': 'rating',
         'plot': 'plot',
         'director': 'director',
@@ -159,6 +159,14 @@ class ImportPlugin(IP):
         # genre can be multiple items, join by comma
         details['genre'] = ', '.join(n.text for n in item.findall('genre'))
 
+        # build text for 'cast' field
+        cast = []
+        for actor in item.findall('actor'):
+            cast.append('%s as %s' % (actor.findtext('name'), actor.findtext('role')))
+
+        if cast:
+            details['cast'] = "\n".join(cast)
+
         # increment for next iteration
         self.itemindex = self.itemindex + 1
 
This page took 0.08585 seconds and 4 git commands to generate.