Commit 9f587084 authored by Ilkka Ollakka's avatar 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 dd9997bc.
This reverts commit 5c29e5fc.
parent 71408802
...@@ -54,7 +54,7 @@ end ...@@ -54,7 +54,7 @@ end
-- Return the artwork -- Return the artwork
function fetch_art() function fetch_art()
local meta = vlc.input.item():metas() local meta = vlc.item:metas()
if not (meta["artist"] and meta["album"]) then if not (meta["artist"] and meta["album"]) then
return nil return nil
end end
......
...@@ -40,7 +40,7 @@ function fetch_art() ...@@ -40,7 +40,7 @@ function fetch_art()
["Virgin 17"] = "http://upload.wikimedia.org/wikipedia/fr/3/39/Virgin17logo.png", ["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" ["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 local channel
if meta["title"] then if meta["title"] then
channel = meta["title"] channel = meta["title"]
......
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
-- Return the artwork -- Return the artwork
function fetch_art() function fetch_art()
if vlc.input == nil then return nil end if vlc.item == nil then return nil end
local item = vlc.input.item() local meta = vlc.item:metas()
local meta = item:metas()
if meta["artist"] and meta["album"] then if meta["artist"] and meta["album"] then
title = meta["artist"].."/"..meta["album"] title = meta["artist"].."/"..meta["album"]
else else
......
...@@ -28,7 +28,7 @@ function get_query( title ) ...@@ -28,7 +28,7 @@ function get_query( title )
end end
function fetch_meta() function fetch_meta()
local metas = vlc.input.item():metas() local metas = vlc.item:metas()
local showName = metas["showName"] local showName = metas["showName"]
if not showName then if not showName then
...@@ -73,9 +73,9 @@ function fetch_meta() ...@@ -73,9 +73,9 @@ function fetch_meta()
return false return false
end end
vlc.input.item():set_meta("title", showName.. " S"..seasonNumber.."E"..episodeNumber.." - ".. title) vlc.item:set_meta("title", showName.. " S"..seasonNumber.."E"..episodeNumber.." - ".. title)
vlc.input.item():set_meta("artwork_url", artwork) vlc.item:set_meta("artwork_url", artwork)
vlc.input.item():set_meta("episodeName", title) vlc.item:set_meta("episodeName", title)
return true return true
end end
...@@ -24,7 +24,7 @@ function trim (s) ...@@ -24,7 +24,7 @@ function trim (s)
end end
function read_meta() function read_meta()
local metas = vlc.input.item():metas() local metas = vlc.item:metas()
-- Don't do anything if there is already a title -- Don't do anything if there is already a title
if metas["title"] then if metas["title"] then
...@@ -45,8 +45,8 @@ function read_meta() ...@@ -45,8 +45,8 @@ function read_meta()
-- Remove . in showName -- Remove . in showName
showName = trim(string.gsub(showName, "%.", " ")) showName = trim(string.gsub(showName, "%.", " "))
vlc.input.item():set_meta("title", showName.." S"..seasonNumber.."E"..episodeNumber) vlc.item:set_meta("title", showName.." S"..seasonNumber.."E"..episodeNumber)
vlc.input.item():set_meta("showName", showName) vlc.item:set_meta("showName", showName)
vlc.input.item():set_meta("episodeNumber", episodeNumber) vlc.item:set_meta("episodeNumber", episodeNumber)
vlc.input.item():set_meta("seasonNumber", seasonNumber) vlc.item:set_meta("seasonNumber", seasonNumber)
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment