]> git.sesse.net Git - vlc/commitdiff
use requested item for meta fetching instead of currently playing one
authorIlkka Ollakka <ileoo@videolan.org>
Wed, 14 Apr 2010 10:08:39 +0000 (13:08 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Wed, 14 Apr 2010 10:09:10 +0000 (13:09 +0300)
Revert "lua: fix my previous commit (missing '()')."
Revert "Lua: fix the remaining scripts."

This reverts commit dd9997bcbff0665bfd74a92f9aed25a787b24680.
This reverts commit 5c29e5fc20816bf9d03600a557fead12a9ef716b.

share/lua/meta/art/01_musicbrainz.lua
share/lua/meta/art/02_frenchtv.lua
share/lua/meta/art/03_lastfm.lua
share/lua/meta/fetcher/tvrage.lua
share/lua/meta/reader/filename.lua

index ab537d6c28165b6d8469825eca4f678710d6f14d..934e9ad310c768fffaee9603d11c05656d915ac2 100644 (file)
@@ -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
index 92032fe7cacbd3511b2c822034c84dab6fb69db8..957f0d63a64aa5b543d78619e5f7dc0def9aa555 100644 (file)
@@ -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"]
index ed5586651f7471649a478361e412ea4fbc97fcf6..0e120e1c37077c35f8a7ccda915d3d3770d93e72 100644 (file)
@@ -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
index 8febd166ab4d7ca89de980ae51c9a7ce66725013..22a391d986fdeafd9628dbc4f47496e6e3070c34 100644 (file)
@@ -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
index 230c688c2ba0a10aa110e56bd609ed84f4360124..a1b41737ddbb8720f5ac3fa5f7011fc742ed2b90 100644 (file)
@@ -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