add artist for musicvideos in listitem.setInfo(). Closes #12886
authorJonathan Marshall <jmarshall@never.you.mind>
Sun, 15 Apr 2012 10:25:34 +0000 (22:25 +1200)
committerJonathan Marshall <jmarshall@never.you.mind>
Wed, 2 May 2012 06:32:55 +0000 (18:32 +1200)
xbmc/interfaces/python/xbmcmodule/listitem.cpp

index 73a46fc..e6d67ec 100644 (file)
@@ -363,6 +363,7 @@ namespace PYXBMC
     "    credits       : string (Andy Kaufman) - writing credits\n"
     "    lastplayed    : string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)\n"
     "    album         : string (The Joshua Tree)\n"
+    "    artist        : list (['U2'])\n"
     "    votes         : string (12345 votes)\n"
     "    trailer       : string (/home/user/trailer.avi)\n"
     "\n"
@@ -472,6 +473,19 @@ namespace PYXBMC
             self->item->GetVideoInfoTag()->m_cast.push_back(info);
           }
         }
+        else if (strcmpi(PyString_AsString(key), "artist") == 0)
+        {
+          if (!PyObject_TypeCheck(value, &PyList_Type)) continue;
+          self->item->GetVideoInfoTag()->m_artist.clear();
+          for (int i = 0; i < PyList_Size(value); i++)
+          {
+            PyObject *pActor = PyList_GetItem(value, i);
+            if (pActor == NULL) continue;
+            CStdString actor;
+            if (!PyXBMCGetUnicodeString(actor, pActor, 1)) continue;
+            self->item->GetVideoInfoTag()->m_artist.push_back(actor);
+          }
+        }
         else
         {
           if (!PyXBMCGetUnicodeString(tmp, value, 1)) continue;