Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49cc36ef31 | |||
| fe70315a63 | |||
| 3aec58719b | |||
| b86f583f42 | |||
| ae1eca427f | |||
| 64b07ad34d | |||
| 6fbc87a465 | |||
| c88c43fd8e | |||
| 807e124570 | |||
| 0493632932 | |||
| ce4f7f54da | |||
| 9df7ed5be8 | |||
| 82035ea239 | |||
| b47f7c8e75 | |||
| dc196fb621 |
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Wasted Audio
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -18,7 +18,7 @@ local function Latesthandler(self)
|
|||||||
local file_data = {}
|
local file_data = {}
|
||||||
|
|
||||||
file_data["name"] = latest_name[i]
|
file_data["name"] = latest_name[i]
|
||||||
file_data["url"] = data_path .. escape(file)
|
file_data["url"] = data_path .. file
|
||||||
|
|
||||||
table.insert(latest_json["files"], file_data)
|
table.insert(latest_json["files"], file_data)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
local to_json = require("lapis.util").to_json
|
|
||||||
local autoload = require("lapis.util").autoload
|
local autoload = require("lapis.util").autoload
|
||||||
local config = require("lapis.config")
|
local config = require("lapis.config")
|
||||||
local hotmixes = autoload("hotmixes")
|
local hotmixes = autoload("hotmixes")
|
||||||
@@ -17,6 +16,7 @@ local function Roothandler(self)
|
|||||||
self.images = stuff.images
|
self.images = stuff.images
|
||||||
self.latestpath = latest_path
|
self.latestpath = latest_path
|
||||||
self.latestname = latest_name
|
self.latestname = latest_name
|
||||||
|
self.functions = { hotesc = hotmixes.utils.hotesc }
|
||||||
|
|
||||||
if self.titles['url'] == "panamaracing.club" then
|
if self.titles['url'] == "panamaracing.club" then
|
||||||
return { render = "root", layout = require "views.prc_layout" }
|
return { render = "root", layout = require "views.prc_layout" }
|
||||||
|
|||||||
+12
-2
@@ -1,5 +1,6 @@
|
|||||||
local lfs = require 'lfs_ffi'
|
local lfs = require 'lfs_ffi'
|
||||||
local config = require("lapis.config").get()
|
local config = require("lapis.config").get()
|
||||||
|
local escape = require("lapis.util").escape
|
||||||
|
|
||||||
|
|
||||||
-- setup
|
-- setup
|
||||||
@@ -14,7 +15,7 @@ end
|
|||||||
|
|
||||||
local request_path
|
local request_path
|
||||||
if request_uri ~= '/' then
|
if request_uri ~= '/' then
|
||||||
request_path = request_uri .. '/'
|
request_path = request_uri .. '/'
|
||||||
else
|
else
|
||||||
request_path = request_uri
|
request_path = request_uri
|
||||||
end
|
end
|
||||||
@@ -29,6 +30,10 @@ local type_allowed = { jpg=true, jpeg=true, png=true, gif=true, mp3=true, flac=t
|
|||||||
|
|
||||||
local utils = {}
|
local utils = {}
|
||||||
|
|
||||||
|
local function hotesc ( str )
|
||||||
|
return escape(str):gsub("%%2f", "/"):gsub("%%2d", "-"):gsub("%%2e", ".")
|
||||||
|
end
|
||||||
|
|
||||||
utils['request_path'] = request_path
|
utils['request_path'] = request_path
|
||||||
utils['data_path'] = data_path
|
utils['data_path'] = data_path
|
||||||
|
|
||||||
@@ -83,12 +88,17 @@ utils['these_files'] = function( path )
|
|||||||
return stuff
|
return stuff
|
||||||
end
|
end
|
||||||
|
|
||||||
|
utils['hotesc'] = function( str )
|
||||||
|
return hotesc(str)
|
||||||
|
end
|
||||||
|
|
||||||
utils['these_latest'] = function( path )
|
utils['these_latest'] = function( path )
|
||||||
-- list last 10 modified files in our directory
|
-- list last 10 modified files in our directory
|
||||||
local latest_path, latest_name = {}, {}
|
local latest_path, latest_name = {}, {}
|
||||||
|
|
||||||
for i, file_path in ipairs( utils.latest_files( path ) ) do
|
for i, file_path in ipairs( utils.latest_files( path ) ) do
|
||||||
table.insert( latest_path, file_path)
|
local escpath = hotesc(file_path)
|
||||||
|
table.insert( latest_path, escpath )
|
||||||
|
|
||||||
local temp = ""
|
local temp = ""
|
||||||
local result = ""
|
local result = ""
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<h1 class="h1">Latest uploads:</h1>
|
<h1 class="h1">Latest uploads:</h1>
|
||||||
<% for i, file in ipairs(latestpath) do %>
|
<% for i, file in ipairs(latestpath) do %>
|
||||||
<a class="amixlink" href="<%= '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %>">
|
<a class="amixlink" href="<%= '/data/' .. titles.url .. '/' .. file %>">
|
||||||
<span class="mixlink"><%= latestname[i] %></span>
|
<span class="mixlink"><%= latestname[i] %></span>
|
||||||
</a>
|
</a>
|
||||||
</br>
|
</br>
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
<% for i, dir in ipairs(dirs) do %>
|
<% for i, dir in ipairs(dirs) do %>
|
||||||
<br>
|
<br>
|
||||||
<a href="<%= uri .. dir %>" class="djsection"><span><%= dir %></span></a>
|
<a href="<%- functions.hotesc(uri .. dir) %>" class="djsection"><span><%= dir %></span></a>
|
||||||
<br>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<% for i, file in ipairs(files) do %>
|
<% for i, file in ipairs(files) do %>
|
||||||
<a class="amixlink" href="<%= path .. file:gsub("#", "%%23") %>">
|
<a class="amixlink" href="<%- functions.hotesc(path .. file) %>">
|
||||||
<span class="mixlink"><%= file %></span>
|
<span class="mixlink"><%= file %></span>
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user