[grilo-plugins] lua-factory: port grl-euronews.lua to the new lua system
- From: Victor Toso de Carvalho <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] lua-factory: port grl-euronews.lua to the new lua system
- Date: Sat, 30 Jan 2016 11:25:09 +0000 (UTC)
commit 592bb1c7a5315e4f2582dad415e03e42f5a43cad
Author: George Sedov <radist morse gmail com>
Date: Wed Dec 16 18:26:56 2015 +0300
lua-factory: port grl-euronews.lua to the new lua system
https://bugzilla.gnome.org/show_bug.cgi?id=753141
Acked-by: Victor Toso <me victortoso com>
src/lua-factory/sources/grl-euronews.lua | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-euronews.lua b/src/lua-factory/sources/grl-euronews.lua
index 061cd20..ceef955 100644
--- a/src/lua-factory/sources/grl-euronews.lua
+++ b/src/lua-factory/sources/grl-euronews.lua
@@ -40,11 +40,11 @@ source = {
-- Source utils --
------------------
-function grl_source_browse(media_id)
- if grl.get_options("skip") > 0 then
- grl.callback()
+function grl_source_browse(media, options, callback)
+ if options.skip > 0 then
+ callback()
else
- grl.fetch(EURONEWS_URL, "euronews_fetch_cb")
+ grl.fetch(EURONEWS_URL, euronews_fetch_cb, callback)
end
end
@@ -53,23 +53,23 @@ end
------------------------
-- return all the media found
-function euronews_fetch_cb(results)
+function euronews_fetch_cb(results, callback)
local json = {}
json = grl.lua.json.string_to_table(results)
if not json or json.stat == "fail" or not json.primary then
- grl.callback()
+ callback()
return
end
for index, item in pairs(json.primary) do
local media = create_media(index, item)
if media ~= nil then
- grl.callback(media, -1)
+ callback(media, -1)
end
end
- grl.callback()
+ callback()
end
-------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]