summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sedov <radist.morse@gmail.com>2015-12-16 18:26:56 +0300
committerVictor Toso <me@victortoso.com>2016-01-30 12:19:08 +0100
commit592bb1c7a5315e4f2582dad415e03e42f5a43cad (patch)
tree59e16fb5b47a2985beb29bf244dba1047783afd3
parentbea8e082da513d90660de84f9213a4fd9552d2eb (diff)
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>
-rw-r--r--src/lua-factory/sources/grl-euronews.lua16
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
-------------