Browse Source

lua: httprequests: do not use deprecated module function

(cherry picked from commit 82dd26ccaf)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
cherry-pick-c5513cf9
Marvin Scholz 5 years ago
committed by Rémi Denis-Courmont
parent
commit
b922d86fa0
  1. 2
      share/lua/http/requests/browse.json
  2. 2
      share/lua/http/requests/browse.xml
  3. 2
      share/lua/http/requests/playlist.json
  4. 4
      share/lua/http/requests/playlist.xml
  5. 2
      share/lua/http/requests/status.json
  6. 2
      share/lua/http/requests/status.xml
  7. 17
      share/lua/intf/modules/httprequests.lua

2
share/lua/http/requests/browse.json

@ -26,7 +26,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
httprequests.processcommands()

2
share/lua/http/requests/browse.xml

@ -27,7 +27,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
httprequests.processcommands()

2
share/lua/http/requests/playlist.json

@ -26,7 +26,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
httprequests.processcommands()

4
share/lua/http/requests/playlist.xml

@ -28,7 +28,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
local printleaf = function(item)
print ("\n<leaf")
@ -88,4 +88,4 @@ local pt=httprequests.playlisttable()
printitem(pt)
?>
?>

2
share/lua/http/requests/status.json

@ -26,7 +26,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
httprequests.processcommands()

2
share/lua/http/requests/status.xml

@ -28,7 +28,7 @@ vim:syntax=lua
<?vlc
--package.loaded.httprequests = nil --uncomment to debug changes
require "httprequests"
local httprequests = require "httprequests"
httprequests.processcommands()

17
share/lua/intf/modules/httprequests.lua

@ -21,7 +21,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]==========================================================================]
module("httprequests",package.seeall)
local httprequests = {}
local common = require ("common")
local dkjson = require ("dkjson")
@ -38,6 +38,7 @@ function round(what, precision)
end
return nil
end
httprequests.round = round
--split text where it matches the delimiter
function strsplit(text, delimiter)
@ -63,6 +64,7 @@ function strsplit(text, delimiter)
end
return list
end
httprequests.strsplit = strsplit
--main function to process commands sent with the request
@ -206,6 +208,7 @@ processcommands = function ()
local val = nil
end
httprequests.processcommands = processcommands
--utilities for formatting output
@ -218,6 +221,7 @@ function xmlString(s)
return tostring(s)
end
end
httprequests.xmlString = xmlString
--dkjson outputs numbered tables as arrays
--so we don't need the array indicators
@ -237,6 +241,7 @@ function removeArrayIndicators(dict)
return newDict
end
httprequests.removeArrayIndicators = removeArrayIndicators
printTableAsJson = function (dict)
dict=removeArrayIndicators(dict)
@ -244,6 +249,7 @@ printTableAsJson = function (dict)
local output=dkjson.encode (dict, { indent = true })
print(output)
end
httprequests.printTableAsJson = printTableAsJson
local printXmlKeyValue = function (k,v,indent)
print("\n")
@ -269,12 +275,14 @@ local printXmlKeyValue = function (k,v,indent)
end
end
end
httprequests.printXmlKeyValue = printXmlKeyValue
printTableAsXml = function (dict,indent)
for k,v in pairs(dict) do
printXmlKeyValue(k,v,indent)
end
end
httprequests.printTableAsXml = printTableAsXml
--[[
function logTable(t,pre)
@ -309,6 +317,7 @@ getplaylist = function ()
return p
end
httprequests.getplaylist = getplaylist
parseplaylist = function (item)
if item.flags.disabled then return end
@ -357,6 +366,7 @@ parseplaylist = function (item)
end
end
httprequests.parseplaylist = parseplaylist
playlisttable = function ()
@ -364,6 +374,7 @@ playlisttable = function ()
return parseplaylist(basePlaylist)
end
httprequests.playlisttable = playlisttable
getbrowsetable = function ()
@ -441,6 +452,7 @@ getbrowsetable = function ()
return result;
end
httprequests.getbrowsetable = getbrowsetable
getstatus = function (includecategories)
@ -553,4 +565,7 @@ getstatus = function (includecategories)
end
return s
end
httprequests.getstatus = getstatus
_G.httprequests = httprequests
return httprequests

Loading…
Cancel
Save