Commits

Vlad Svoka committed 714eba3

fixed error if there is no albums, changed API to new one

  • Participants
  • Parent commits d591719

Comments (0)

Files changed (1)

File xbmc-vk.svoka.com/xvimage.py

 
 
     def GetAlbums(self):
-        albums=self.api.call("photos.getAlbums")
-        q = []
-        for album in albums:
-            q.append(str(album["owner_id"]) + "_" + str(album["thumb_id"]))
-
-        thumbs = self.api.call("photos.getById", photos=",".join(q))
-        album_thumbs = dict()
-        for e in thumbs:
-            album_thumbs[str(e["aid"])] = e["src"]
-
+        albums=self.api.call("photos.getAlbums", need_covers=1)
         items = []
         for a in albums:
+            print a.get('thumb_src')
             e = ( a["title"] + unicode(" (%s photo)" % a["size"]),
                   a["description"],
-                  album_thumbs[str(a["aid"])],
+                  a.get('thumb_src'),
                   str(a["aid"]),
                   a["owner_id"]  )
             items.append(e)