]> git.sesse.net Git - vlc/commitdiff
lua sd: add source as meta for faster skipping of unrelated resources
authorFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 4 Jun 2012 18:15:59 +0000 (20:15 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 4 Jun 2012 18:39:09 +0000 (20:39 +0200)
share/lua/meta/art/00_musicbrainz.lua
share/lua/meta/art/01_googleimage.lua
share/lua/meta/art/03_lastfm.lua
share/lua/sd/freebox.lua
share/lua/sd/icecast.lua

index 32f98c264326fcd3855fd4ac5635d2a4394beb8b..2e224f43a145fc4c37ae99ce90f69be5a07d791b 100644 (file)
@@ -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 )
index 6a3e451b809e0b0be36c13ee3ad5417f90b4fc72..889b094ce2e60da2c96762eb0ce27c989ca14bbe 100644 (file)
@@ -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"
index 0e120e1c37077c35f8a7ccda915d3d3770d93e72..a46b92c440797d567fbc301d0ceab9dd6a2b91b2 100644 (file)
 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
index 844cb8dcfa1607dade5f66acd05cea106343b8d0..d2080ff11cb67c95eed45bad751bc0e84d5d23e2 100644 (file)
@@ -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
index ee10dd6260006a92d7685b0151f808246af5b015..c1efe2113d02c1009dcb28dcfef40c5a396c311c 100644 (file)
@@ -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]
                           }} )