Compare commits
No commits in common. "49cc36ef31ccf752bec4d594c21bc75467ac2126" and "64b07ad34de40d51f7e44ad4ad8fc8f7bb919ee4" have entirely different histories.
49cc36ef31
...
64b07ad34d
21
LICENSE
21
LICENSE
@ -1,21 +0,0 @@
|
||||
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.
|
||||
@ -1,4 +1,6 @@
|
||||
local to_json = require("lapis.util").to_json
|
||||
local autoload = require("lapis.util").autoload
|
||||
local escape = require("lapis.util").escape
|
||||
local config = require("lapis.config")
|
||||
local hotmixes = autoload("hotmixes")
|
||||
|
||||
@ -9,14 +11,14 @@ local function Roothandler(self)
|
||||
local latest_path, latest_name = hotmixes.utils.these_latest( path )
|
||||
|
||||
self.total = hotmixes.utils.total_files_dir( path )
|
||||
self.uri = hotmixes.utils.request_path
|
||||
self.uri = hotmixes.utils.request_path:sub(2) -- remove leading slash
|
||||
self.path = '/data/' .. self.titles.url .. hotmixes.utils.request_path
|
||||
self.dirs = stuff.dirs
|
||||
self.files = stuff.files
|
||||
self.images = stuff.images
|
||||
self.latestpath = latest_path
|
||||
self.latestname = latest_name
|
||||
self.functions = { hotesc = hotmixes.utils.hotesc }
|
||||
self.functions = { escape = escape }
|
||||
|
||||
if self.titles['url'] == "panamaracing.club" then
|
||||
return { render = "root", layout = require "views.prc_layout" }
|
||||
|
||||
@ -30,10 +30,6 @@ local type_allowed = { jpg=true, jpeg=true, png=true, gif=true, mp3=true, flac=t
|
||||
|
||||
local utils = {}
|
||||
|
||||
local function hotesc ( str )
|
||||
return escape(str):gsub("%%2f", "/"):gsub("%%2d", "-"):gsub("%%2e", ".")
|
||||
end
|
||||
|
||||
utils['request_path'] = request_path
|
||||
utils['data_path'] = data_path
|
||||
|
||||
@ -88,17 +84,12 @@ utils['these_files'] = function( path )
|
||||
return stuff
|
||||
end
|
||||
|
||||
utils['hotesc'] = function( str )
|
||||
return hotesc(str)
|
||||
end
|
||||
|
||||
utils['these_latest'] = function( path )
|
||||
-- list last 10 modified files in our directory
|
||||
local latest_path, latest_name = {}, {}
|
||||
|
||||
for i, file_path in ipairs( utils.latest_files( path ) ) do
|
||||
local escpath = hotesc(file_path)
|
||||
table.insert( latest_path, escpath )
|
||||
table.insert( latest_path, escape(file_path))
|
||||
|
||||
local temp = ""
|
||||
local result = ""
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
|
||||
<% for i, dir in ipairs(dirs) do %>
|
||||
<br>
|
||||
<a href="<%- functions.hotesc(uri .. dir) %>" class="djsection"><span><%= dir %></span></a>
|
||||
<a href="<%- functions.escape(uri .. dir) %>" class="djsection"><span><%= dir %></span></a>
|
||||
<br>
|
||||
<% end %>
|
||||
<br>
|
||||
|
||||
<% for i, file in ipairs(files) do %>
|
||||
<a class="amixlink" href="<%- functions.hotesc(path .. file) %>">
|
||||
<a class="amixlink" href="<%- functions.escape(path .. file):gsub("%%2f", "/") %>">
|
||||
<span class="mixlink"><%= file %></span>
|
||||
</a>
|
||||
<br>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user