[grilo-plugins] Bug: fix grl.fetch() parameter order in lua plugins



commit 3e9e8d5428798ed3d73e296e864f889849dad235
Author: Tony Crisci <tony dubstepdish com>
Date:   Sat Sep 29 14:46:26 2018 -0400

    Bug: fix grl.fetch() parameter order in lua plugins
    
    The grl.fetch() functions expects the arguments in the order of 1) the
    url to connect to, 2) the net options, 3) the callback, and 4) the user
    data. Some of the plugins were switching 2) and 3). This caused an issue
    where the net options were ignored.

 src/lua-factory/sources/grl-metrolyrics.lua      | 2 +-
 src/lua-factory/sources/grl-musicbrainz.lua      | 2 +-
 src/lua-factory/sources/grl-theaudiodb-cover.lua | 2 +-
 src/lua-factory/sources/grl-thegamesdb.lua       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-metrolyrics.lua b/src/lua-factory/sources/grl-metrolyrics.lua
index 067ede1..5e10a3b 100644
--- a/src/lua-factory/sources/grl-metrolyrics.lua
+++ b/src/lua-factory/sources/grl-metrolyrics.lua
@@ -71,7 +71,7 @@ function grl_source_resolve()
   title = title:gsub("%s+", "-")
   title = grl.encode(title)
   url = string.format(METROLYRICS_DEFAULT_QUERY, title, artist)
-  grl.fetch(url, fetch_page_cb, netopts)
+  grl.fetch(url, netopts, fetch_page_cb)
 end
 
 ---------------
diff --git a/src/lua-factory/sources/grl-musicbrainz.lua b/src/lua-factory/sources/grl-musicbrainz.lua
index 566e025..64e065b 100644
--- a/src/lua-factory/sources/grl-musicbrainz.lua
+++ b/src/lua-factory/sources/grl-musicbrainz.lua
@@ -69,7 +69,7 @@ function grl_source_resolve()
     end
   end
 
-  grl.fetch(urls, fetch_results_cb, netopts)
+  grl.fetch(urls, netopts, fetch_results_cb)
 end
 
 ---------------
diff --git a/src/lua-factory/sources/grl-theaudiodb-cover.lua 
b/src/lua-factory/sources/grl-theaudiodb-cover.lua
index 85b5a3f..2b3b129 100644
--- a/src/lua-factory/sources/grl-theaudiodb-cover.lua
+++ b/src/lua-factory/sources/grl-theaudiodb-cover.lua
@@ -76,7 +76,7 @@ function grl_source_resolve()
   artist = grl.encode(keys.artist)
   album = grl.encode(keys.album)
   url = string.format(THEAUDIODB_SEARCH_ALBUM, theaudiodb.api_key, artist, album)
-  grl.fetch(url, fetch_cb, netopts)
+  grl.fetch(url, netopts, fetch_cb)
 end
 
 ---------------
diff --git a/src/lua-factory/sources/grl-thegamesdb.lua b/src/lua-factory/sources/grl-thegamesdb.lua
index c93737f..717b8b8 100644
--- a/src/lua-factory/sources/grl-thegamesdb.lua
+++ b/src/lua-factory/sources/grl-thegamesdb.lua
@@ -69,7 +69,7 @@ function grl_source_resolve()
     end
   end
   grl.debug('Fetching URL ' .. url .. ' for game ' .. req.title .. ' (' .. tostring(req.mime_type) ..')')
-  grl.fetch(url, fetch_results_cb, netopts)
+  grl.fetch(url, netopts, fetch_results_cb)
 end
 
 ---------------


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