[grilo-plugins] lua-factory: Fix broken URLs for Euronews outside Europe



commit 15443d2f63cf88d1186f4d92f4d7ac7552b86814
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 4 18:48:13 2014 +0200

    lua-factory: Fix broken URLs for Euronews outside Europe
    
    From some locations, Euronews will not make all of its streams
    available. This ensures that we filter out the streams that aren't
    available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731224

 src/lua-factory/sources/grl-euronews.lua |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-euronews.lua b/src/lua-factory/sources/grl-euronews.lua
index 5fb69e3..bdca090 100644
--- a/src/lua-factory/sources/grl-euronews.lua
+++ b/src/lua-factory/sources/grl-euronews.lua
@@ -63,7 +63,9 @@ function euronews_fetch_cb(results)
 
   for index, item in pairs(json.primary) do
     local media = create_media(index, item)
-    grl.callback(media, -1)
+    if media ~= nil then
+      grl.callback(media, -1)
+    end
   end
 
   grl.callback()
@@ -101,6 +103,10 @@ end
 function create_media(lang, item)
   local media = {}
 
+  if item.rtmp_flash["750"].name == 'UNAVAILABLE' then
+    return nil
+  end
+
   media.type = "video"
   media.id = lang
   media.title = "Euronews " .. get_lang(lang)


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