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



commit 1310c86b58ca2268e1a48d94665c1502546735bd
Author: Victor Toso <me victortoso com>
Date:   Tue Mar 8 23:28:06 2016 +0100

    Revert "lua-factory: port grl-video-title-parsing.lua to the new lua system"
    
    This reverts commit 46b127a9ccee3a01f95bee47e81305238ab17f3a.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763046

 .../sources/grl-video-title-parsing.lua            |   27 +++++++++++--------
 1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-video-title-parsing.lua 
b/src/lua-factory/sources/grl-video-title-parsing.lua
index d860e8e..9c790d4 100644
--- a/src/lua-factory/sources/grl-video-title-parsing.lua
+++ b/src/lua-factory/sources/grl-video-title-parsing.lua
@@ -129,35 +129,40 @@ function parse_as_episode(media)
   return false
 end
 
-function grl_source_resolve(media, options, callback)
+function grl_source_resolve()
+  local req
+  local media = {}
 
-  if not media or not media.title then
-    callback()
+  req = grl.get_media_keys()
+  if not req or not req.title then
+    grl.callback()
     return
   end
 
+  media.title = req.title
+
   -- It is easier to identify a tv show due information
   -- related to episode and season number
   if parse_as_episode(media) then
-    grl.debug(media.title .. " is an EPISODE")
-    callback(media, 0)
+    grl.debug(req.title .. " is an EPISODE")
+    grl.callback(media, 0)
     return
   end
 
   if parse_as_movie(media) then
-    grl.debug(media.title .. " is a MOVIE")
-    callback(media, 0)
+    grl.debug(req.title .. " is a MOVIE")
+    grl.callback(media, 0)
     return
   end
 
   local suffix_removed
   media.title, suffix_removed = remove_suffix(media.title)
   if media.title and suffix_removed then
-    grl.debug(media.title .. " is a MOVIE (without suffix)")
-    callback(media, 0)
+    grl.debug(req.title .. " is a MOVIE (without suffix)")
+    grl.callback(media, 0)
     return
   end
 
-  grl.debug("Fail to identify video: " .. media.title)
-  callback()
+  grl.debug("Fail to identify video: " .. req.title)
+  grl.callback()
 end


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