Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d3480941
Commit
d3480941
authored
Dec 22, 2009
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify lua http's custom.lua. Print any errors while loading custom.lua in the debug output.
parent
054c7f95
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
share/lua/http/custom.lua
share/lua/http/custom.lua
+9
-17
share/lua/intf/http.lua
share/lua/intf/http.lua
+1
-1
No files found.
share/lua/http/custom.lua
View file @
d3480941
local
_G
=
_G
module
(
"custom"
,
package
.
seeall
)
local
dialogs_cache
=
{}
function
dialog_preload
(
name
)
if
not
dialogs_cache
[
name
]
then
local
dialogs
=
setmetatable
({},
{
__index
=
function
(
self
,
name
)
-- Cache the dialogs
dialogs_cache
[
name
]
=
process
(
http_dir
..
"/dialogs/"
..
name
)
end
end
function
dialog
(
name
)
dialog_preload
(
name
)
dialogs_cache
[
name
]()
end
return
rawget
(
self
,
name
)
or
rawget
(
rawset
(
self
,
name
,
process
(
http_dir
..
"/dialogs/"
..
name
)),
name
)
end
})
function
dialogs
(
...
)
for
i
=
1
,
select
(
"#"
,
...
)
do
dialog
(
select
(
i
,
...
)
)
_G
.
dialogs
=
function
(
...
)
for
i
=
1
,
select
(
"#"
,
...
)
do
dialog
s
[(
select
(
i
,
...
))](
)
end
end
_G
.
dialogs
=
dialogs
_G
.
vlm
=
vlc
.
vlm
()
share/lua/intf/http.lua
View file @
d3480941
...
...
@@ -258,7 +258,7 @@ do
package.path
=
http_dir
..
"/?.lua"
local
ok
,
err
=
pcall
(
require
,
"custom"
)
if
not
ok
then
vlc
.
msg
.
warn
(
"Couldn't load "
..
http_dir
..
"/custom.lua"
)
vlc
.
msg
.
warn
(
"Couldn't load "
..
http_dir
..
"/custom.lua"
,
err
)
else
vlc
.
msg
.
dbg
(
"Loaded "
..
http_dir
..
"/custom.lua"
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment