[vlc-commits] commit: use requested item for meta fetching instead of currently playing one ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Wed Apr 14 12:11:24 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Apr 14 13:08:39 2010 +0300| [9f587084421383e9fc8f6b82909cb37d07063f32] | committer: Ilkka Ollakka 

use requested item for meta fetching instead of currently playing one

Revert "lua: fix my previous commit (missing '()')."
Revert "Lua: fix the remaining scripts."

This reverts commit dd9997bcbff0665bfd74a92f9aed25a787b24680.
This reverts commit 5c29e5fc20816bf9d03600a557fead12a9ef716b.

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

 share/lua/meta/art/01_musicbrainz.lua |    2 +-
 share/lua/meta/art/02_frenchtv.lua    |    2 +-
 share/lua/meta/art/03_lastfm.lua      |    5 ++---
 share/lua/meta/fetcher/tvrage.lua     |    8 ++++----
 share/lua/meta/reader/filename.lua    |   10 +++++-----
 5 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/share/lua/meta/art/01_musicbrainz.lua b/share/lua/meta/art/01_musicbrainz.lua
index ab537d6..934e9ad 100644
--- a/share/lua/meta/art/01_musicbrainz.lua
+++ b/share/lua/meta/art/01_musicbrainz.lua
@@ -54,7 +54,7 @@ end
 
 -- Return the artwork
 function fetch_art()
-    local meta = vlc.input.item():metas()
+    local meta = vlc.item:metas()
     if not (meta["artist"] and meta["album"]) then
         return nil
     end
diff --git a/share/lua/meta/art/02_frenchtv.lua b/share/lua/meta/art/02_frenchtv.lua
index 92032fe..957f0d6 100644
--- a/share/lua/meta/art/02_frenchtv.lua
+++ b/share/lua/meta/art/02_frenchtv.lua
@@ -40,7 +40,7 @@ function fetch_art()
         ["Virgin 17"] = "http://upload.wikimedia.org/wikipedia/fr/3/39/Virgin17logo.png",
         ["La Chaîne Parlementaire"] = "http://upload.wikimedia.org/wikipedia/fr/9/98/Public-Senat-LCP-An_logo_2010.png"
     }
-    local meta = vlc.input.item():metas();
+    local meta = vlc.item:metas();
     local channel
     if meta["title"] then
         channel = meta["title"]
diff --git a/share/lua/meta/art/03_lastfm.lua b/share/lua/meta/art/03_lastfm.lua
index ed55866..0e120e1 100644
--- a/share/lua/meta/art/03_lastfm.lua
+++ b/share/lua/meta/art/03_lastfm.lua
@@ -21,9 +21,8 @@
 
 -- Return the artwork
 function fetch_art()
-    if vlc.input == nil then return nil end
-    local item = vlc.input.item()
-    local meta = item:metas()
+    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"]
     else
diff --git a/share/lua/meta/fetcher/tvrage.lua b/share/lua/meta/fetcher/tvrage.lua
index 8febd16..22a391d 100644
--- a/share/lua/meta/fetcher/tvrage.lua
+++ b/share/lua/meta/fetcher/tvrage.lua
@@ -28,7 +28,7 @@ function get_query( title )
 end
 
 function fetch_meta()
-    local metas = vlc.input.item():metas()
+    local metas = vlc.item:metas()
 
     local showName = metas["showName"]
     if not showName then
@@ -73,9 +73,9 @@ function fetch_meta()
         return false
     end
 
-    vlc.input.item():set_meta("title", showName.. " S"..seasonNumber.."E"..episodeNumber.." - ".. title)
-    vlc.input.item():set_meta("artwork_url", artwork)
-    vlc.input.item():set_meta("episodeName", title)
+    vlc.item:set_meta("title", showName.. " S"..seasonNumber.."E"..episodeNumber.." - ".. title)
+    vlc.item:set_meta("artwork_url", artwork)
+    vlc.item:set_meta("episodeName", title)
 
     return true
 end
diff --git a/share/lua/meta/reader/filename.lua b/share/lua/meta/reader/filename.lua
index 230c688..a1b4173 100644
--- a/share/lua/meta/reader/filename.lua
+++ b/share/lua/meta/reader/filename.lua
@@ -24,7 +24,7 @@ function trim (s)
 end
 
 function read_meta()
-    local metas = vlc.input.item():metas()
+    local metas = vlc.item:metas()
 
     -- Don't do anything if there is already a title
     if metas["title"] then
@@ -45,8 +45,8 @@ function read_meta()
 
     -- Remove . in showName
     showName = trim(string.gsub(showName, "%.", " "))
-    vlc.input.item():set_meta("title", showName.." S"..seasonNumber.."E"..episodeNumber)
-    vlc.input.item():set_meta("showName", showName)
-    vlc.input.item():set_meta("episodeNumber", episodeNumber)
-    vlc.input.item():set_meta("seasonNumber", seasonNumber)
+    vlc.item:set_meta("title", showName.." S"..seasonNumber.."E"..episodeNumber)
+    vlc.item:set_meta("showName", showName)
+    vlc.item:set_meta("episodeNumber", episodeNumber)
+    vlc.item:set_meta("seasonNumber", seasonNumber)
 end



More information about the vlc-commits mailing list