[vlc-commits] lua: googleimage: try to find art for icecast listings

Francois Cartegnie git at videolan.org
Sun May 27 15:29:24 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun May 27 15:27:39 2012 +0200| [077fd787ca16b3d5a9b98a7205412bd5207f5c83] | committer: Francois Cartegnie

lua: googleimage: try to find art for icecast listings

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=077fd787ca16b3d5a9b98a7205412bd5207f5c83
---

 share/lua/meta/art/01_googleimage.lua |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/share/lua/meta/art/01_googleimage.lua b/share/lua/meta/art/01_googleimage.lua
index 43012e0..6a3e451 100644
--- a/share/lua/meta/art/01_googleimage.lua
+++ b/share/lua/meta/art/01_googleimage.lua
@@ -24,14 +24,20 @@ function fetch_art()
     if vlc.item == nil then return nil end
 
     local meta = vlc.item:metas()
-    if meta["artist"] and meta["album"] then
-        title = meta["artist"].." "..meta["album"]
+
+-- IceCast Entries
+    if meta["Listing Source"] == "dir.xiph.org"
+    then
+        title = meta["title"] .. " radio logo"
+-- Album entries
+    elseif meta["artist"] and meta["album"] then
+        title = meta["artist"].." "..meta["album"].." cover"
     elseif meta["artist"] and meta["title"] then
-        title = meta["artist"].." "..meta["title"]
+        title = meta["artist"].." "..meta["title"].." cover"
     else
         return nil
     end
-    fd = vlc.stream( "http://images.google.com/images?q="..vlc.strings.encode_uri_component( title.." cover" ) )
+    fd = vlc.stream( "http://images.google.com/images?q="..vlc.strings.encode_uri_component( title ) )
     if not fd then return nil end
 
     page = fd:read( 65653 )



More information about the vlc-commits mailing list