[grilo-plugins] Revert "lua-factory: port grl-euronews.lua to the new lua system"



commit 6b7e154d3ba8fa7912a801b3cc087a4b1e73853f
Author: Victor Toso <me victortoso com>
Date:   Tue Mar 8 23:28:02 2016 +0100

    Revert "lua-factory: port grl-euronews.lua to the new lua system"
    
    This reverts commit 592bb1c7a5315e4f2582dad415e03e42f5a43cad.
    
    But keeps grl.fetch callback as function instead of string
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763046

 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 ceef955..643b702 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, options, callback)
-  if options.skip > 0 then
-    callback()
+function grl_source_browse(media_id)
+  if grl.get_options("skip") > 0 then
+    grl.callback()
   else
-    grl.fetch(EURONEWS_URL, euronews_fetch_cb, callback)
+    grl.fetch(EURONEWS_URL, euronews_fetch_cb)
   end
 end
 
@@ -53,23 +53,23 @@ end
 ------------------------
 
 -- return all the media found
-function euronews_fetch_cb(results, callback)
+function euronews_fetch_cb(results)
   local json = {}
 
   json = grl.lua.json.string_to_table(results)
   if not json or json.stat == "fail" or not json.primary then
-    callback()
+    grl.callback()
     return
   end
 
   for index, item in pairs(json.primary) do
     local media = create_media(index, item)
     if media ~= nil then
-      callback(media, -1)
+      grl.callback(media, -1)
     end
   end
 
-  callback()
+  grl.callback()
 end
 
 -------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]