[packages/griffith] import cast field

glen glen at pld-linux.org
Tue Jul 28 19:53:37 CEST 2015


commit 5411d3e07b54a695268a96f851501eebb8846524
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Jul 28 20:23:56 2015 +0300

    import cast field

 Kodi.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/Kodi.py b/Kodi.py
index 2242f3e..585f16e 100644
--- 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
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/griffith.git/commitdiff/91cfb43dc65e71621c542f1b060d1a3d49e7da74



More information about the pld-cvs-commit mailing list