[vlc-commits] lua sd: add source as meta for faster skipping of unrelated resources

Francois Cartegnie git at videolan.org
Mon Jun 4 20:39:20 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun  4 20:15:59 2012 +0200| [c52dde2dbc84706d52414ee649ff572fd4181076] | committer: Francois Cartegnie

lua sd: add source as meta for faster skipping of unrelated resources

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

 share/lua/meta/art/00_musicbrainz.lua |    4 ++++
 share/lua/meta/art/01_googleimage.lua |    8 ++++++--
 share/lua/meta/art/03_lastfm.lua      |    5 +++++
 share/lua/sd/freebox.lua              |    8 +++++++-
 share/lua/sd/icecast.lua              |    1 +
 5 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/share/lua/meta/art/00_musicbrainz.lua b/share/lua/meta/art/00_musicbrainz.lua
index 32f98c2..2e224f4 100644
--- a/share/lua/meta/art/00_musicbrainz.lua
+++ b/share/lua/meta/art/00_musicbrainz.lua
@@ -52,6 +52,10 @@ end
 function fetch_art()
     local meta = vlc.item:metas()
 
+    if meta["Listing Type"] == "radio"
+    or meta["Listing Type"] == "tv"
+    then return nil end
+
     if meta["artist"] and meta["album"] then
         query = "artist:\"" .. meta["artist"] .. "\" AND release:\"" .. meta["album"] .. "\""
         relquery = "http://mb.videolan.org/ws/2/release/?query=" .. vlc.strings.encode_uri_component( query )
diff --git a/share/lua/meta/art/01_googleimage.lua b/share/lua/meta/art/01_googleimage.lua
index 6a3e451..889b094 100644
--- a/share/lua/meta/art/01_googleimage.lua
+++ b/share/lua/meta/art/01_googleimage.lua
@@ -25,10 +25,14 @@ function fetch_art()
 
     local meta = vlc.item:metas()
 
--- IceCast Entries
-    if meta["Listing Source"] == "dir.xiph.org"
+-- Radio Entries
+    if meta["Listing Type"] == "radio"
     then
         title = meta["title"] .. " radio logo"
+-- TV Entries
+    elseif meta["Listing Type"] == "tv"
+    then
+        title = meta["title"] .. " tv logo"
 -- Album entries
     elseif meta["artist"] and meta["album"] then
         title = meta["artist"].." "..meta["album"].." cover"
diff --git a/share/lua/meta/art/03_lastfm.lua b/share/lua/meta/art/03_lastfm.lua
index 0e120e1..a46b92c 100644
--- a/share/lua/meta/art/03_lastfm.lua
+++ b/share/lua/meta/art/03_lastfm.lua
@@ -23,6 +23,11 @@
 function fetch_art()
     if vlc.item == nil then return nil end
     local meta = vlc.item:metas()
+
+    if meta["Listing Type"] == "radio"
+    or meta["Listing Type"] == "tv"
+    then return nil end
+
     if meta["artist"] and meta["album"] then
         title = meta["artist"].."/"..meta["album"]
     else
diff --git a/share/lua/sd/freebox.lua b/share/lua/sd/freebox.lua
index 844cb8d..d2080ff 100644
--- a/share/lua/sd/freebox.lua
+++ b/share/lua/sd/freebox.lua
@@ -86,7 +86,13 @@ function main()
             _, _, option = string.find( line, ":(.+)" )
             table.insert( options, option )
         else
-            vlc.sd.add_item( {path=line,duration=duration,artist=artist,title=name,arturl=arturl,options=options} )
+            vlc.sd.add_item({ path = line,
+                              duration = duration,
+                              artist = artist,
+                              title = name,
+                              arturl = arturl,
+                              meta = {["Listing Type"]="tv"},
+                              options = options })
             duration = nil
             artist = nil
             name = nil
diff --git a/share/lua/sd/icecast.lua b/share/lua/sd/icecast.lua
index ee10dd6..c1efe21 100644
--- a/share/lua/sd/icecast.lua
+++ b/share/lua/sd/icecast.lua
@@ -47,6 +47,7 @@ function main()
                                   .. station.children_map["listen_url"][1].children[1],
                           meta={
                                   ["Listing Source"]="dir.xiph.org",
+                                  ["Listing Type"]="radio",
                                   ["Icecast Bitrate"]=station.children_map["bitrate"][1].children[1],
                                   ["Icecast Server Type"]=station.children_map["server_type"][1].children[1]
                           }} )



More information about the vlc-commits mailing list