]> git.pld-linux.org Git - packages/griffith.git/commitdiff
import other fields as notes
authorElan Ruusamäe <glen@delfi.ee>
Tue, 28 Jul 2015 17:53:15 +0000 (20:53 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 28 Jul 2015 17:53:15 +0000 (20:53 +0300)
Kodi.py

diff --git a/Kodi.py b/Kodi.py
index 585f16e1556c5bfb7414312922184387e642ab06..87dea0a6bd4bba40990081639ac2c5d6252ce3ab 100644 (file)
--- a/Kodi.py
+++ b/Kodi.py
@@ -68,12 +68,24 @@ class ImportPlugin(IP):
         'director': 'director',
         'studio': 'studio',
         'country': 'country',
+        'classification': 'mpaa',
         # while the trailer field exists, it is not useful for griffith
         # as it's something like: "plugin://plugin.video.youtube/?action=play_video&videoid=..."
         # however youtube urls can be probably fixed.
         'trailer': 'trailer',
     }
 
+    # rest of the stuff to insert into notes field
+    notes_map = {
+        _('Id') : 'id',
+        _('Play count'): 'playcount',
+        _('Date added'): 'dateadded',
+        _('Last played'): 'lastplayed',
+        _('Collection'): 'set',
+        _('Premiered'): 'premiered',
+        _('Aired'): 'aired',
+    }
+
     def initialize(self):
         if not IP.initialize(self):
             return False
@@ -167,6 +179,21 @@ class ImportPlugin(IP):
         if cast:
             details['cast'] = "\n".join(cast)
 
+        # put rest of information into notes field
+        notes = []
+        for k,v in self.notes_map.items():
+            v = item.findtext(v)
+            if v:
+                notes.append('%s: %s' % (k, v))
+
+        # credits can have multiple values, handle separately
+        credits = ', '.join(n.text for n in item.findall('credits'))
+        if credits:
+            notes.append(_('Credits: %s') % credits)
+
+        if notes:
+            details['notes'] = "\n".join(notes)
+
         # increment for next iteration
         self.itemindex = self.itemindex + 1
 
This page took 0.063339 seconds and 4 git commands to generate.