[vlc-devel] commit: Lua: fix IMDb script and listen to input changes ( Jean-Philippe André )

git version control git at videolan.org
Sun Feb 14 18:32:42 CET 2010


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Sun Feb 14 18:30:19 2010 +0100| [f4827eb2a47dc96e6d6ecceb56a41817a2457dfd] | committer: Jean-Philippe André 

Lua: fix IMDb script and listen to input changes

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

 share/lua/extensions/imdb.lua |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/share/lua/extensions/imdb.lua b/share/lua/extensions/imdb.lua
index 3b519c8..2a36b1b 100644
--- a/share/lua/extensions/imdb.lua
+++ b/share/lua/extensions/imdb.lua
@@ -32,12 +32,12 @@ function descriptor()
                         .. "Movie Database (IMDb).\nThis Extension will show "
                         .. "you the cast, a short plot summary and a link to "
                         .. "the web page on imdb.org." ;
-             capabilities = {} }
+             capabilities = { "input-listener" } }
 end
 
 -- Update title text field. Removes file extensions.
 function update_title()
-    local item = vlc.item()
+    local item = vlc.input.item()
     local title = item and item:name()
     if title ~= nil then
         title = string.gsub(title, "(.*)(%.%w+)$", "%1")
@@ -47,11 +47,15 @@ function update_title()
     end
 end
 
+function input_changed()
+    update_title()
+end
+
 function create_dialog()
     dlg = vlc.dialog("IMDb Search")
     dlg:add_label("The Internet Movie Database", 1, 1, 4, 1)
     dlg:add_label("<b>Movie Title</b>", 1, 2, 1, 1)
-    local item = vlc.item()
+    local item = vlc.input.item()
     txt = dlg:add_text_input(item and item:name() or "", 2, 2, 1, 1)
     dlg:add_button("Okay", "click_okay", 3, 2, 1, 1)
     dlg:add_button("*", "update_title", 4, 2, 1, 1)




More information about the vlc-devel mailing list