Update lua meta script to new API (untested).
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 13 Jun 2008 09:51:31 +0000 (11:51 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 15 Jun 2008 11:05:55 +0000 (13:05 +0200)
share/lua/meta/googleimage.lua

index 6bc7456..8c27663 100644 (file)
@@ -40,12 +40,12 @@ function fetch_art()
     else
         return nil
     end
-    fd = vlc.stream_new( "http://images.google.com/images?q=" .. get_query( title ) )
-    page = vlc.stream_read( fd, 65653 )
-    vlc.stream_delete( fd )
+    fd = vlc:stream( "http://images.google.com/images?q=" .. get_query( title ) )
+    page = fd:read( 65653 )
+    fd = nil
     _, _, arturl = string.find( page, "imgurl=([^&]+)" )
     if arturl then
-        return vlc.decode_uri(arturl)
+        return vlc.strings.decode_uri(arturl)
     else
         return nil
     end