Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49cc36ef31 | |||
| fe70315a63 | |||
| 3aec58719b | |||
| b86f583f42 | |||
| ae1eca427f | |||
| 64b07ad34d | |||
| 6fbc87a465 | |||
| c88c43fd8e | |||
| 807e124570 | |||
| 0493632932 | |||
| ce4f7f54da | |||
| 9df7ed5be8 | |||
| 82035ea239 | |||
| b47f7c8e75 | |||
| 692747abc5 | |||
| cc62a54571 | |||
| 3165996d6e | |||
| e9d4163a5d | |||
| 52cca8eef2 | |||
| d88674fe40 | |||
| 42ebff2c7c | |||
| 5c7626db66 |
@@ -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.
|
||||
@@ -49,6 +49,11 @@ app:get("/latest.json", function(self)
|
||||
return handlers.Latesthandler(self)
|
||||
end)
|
||||
|
||||
app:get("/latest.xml", function(self)
|
||||
self.titles = page_titles
|
||||
return handlers.RSShandler(self)
|
||||
end)
|
||||
|
||||
app:get("/*", function(self)
|
||||
self.titles = page_titles
|
||||
return handlers.Roothandler(self)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
local to_json = require("lapis.util").to_json
|
||||
local escape = require("lapis.util").escape
|
||||
local autoload = require("lapis.util").autoload
|
||||
local config = require("lapis.config")
|
||||
local hotmixes = autoload("hotmixes")
|
||||
|
||||
local function RSShandler(self)
|
||||
|
||||
local path = config.get().mount .. self.titles.url
|
||||
local latest_path, latest_name = hotmixes.utils.these_latest( path )
|
||||
|
||||
local host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host
|
||||
self.datapath = host .. '/data/' .. self.titles.url .. '/'
|
||||
self.latestpath = latest_path
|
||||
self.latestname = latest_name
|
||||
|
||||
return { content_type = "application/rss+xml", layout = require "views.rss" }
|
||||
end
|
||||
|
||||
return RSShandler
|
||||
@@ -1,4 +1,3 @@
|
||||
local to_json = require("lapis.util").to_json
|
||||
local autoload = require("lapis.util").autoload
|
||||
local config = require("lapis.config")
|
||||
local hotmixes = autoload("hotmixes")
|
||||
@@ -17,6 +16,7 @@ local function Roothandler(self)
|
||||
self.images = stuff.images
|
||||
self.latestpath = latest_path
|
||||
self.latestname = latest_name
|
||||
self.functions = { hotesc = hotmixes.utils.hotesc }
|
||||
|
||||
if self.titles['url'] == "panamaracing.club" then
|
||||
return { render = "root", layout = require "views.prc_layout" }
|
||||
|
||||
+14
-5
@@ -30,6 +30,10 @@ 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
|
||||
|
||||
@@ -64,17 +68,17 @@ utils['these_files'] = function( path )
|
||||
if utils.match_ext( file, type_image ) then
|
||||
table.insert( images, file )
|
||||
elseif utils.match_ext( file, type_media ) then
|
||||
table.insert( files, {sane=escape(file), file=file} )
|
||||
table.insert( files, file )
|
||||
end
|
||||
elseif lfs.attributes( path .. file, "mode" ) == "directory" then
|
||||
table.insert( dirs, {sane=escape(file), dir=file} )
|
||||
table.insert( dirs, file )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
table.sort( images )
|
||||
-- table.sort( files )
|
||||
-- table.sort( dirs )
|
||||
table.sort( files )
|
||||
table.sort( dirs )
|
||||
|
||||
local stuff = {
|
||||
files = files,
|
||||
@@ -84,12 +88,17 @@ 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
|
||||
table.insert( latest_path, escape(file_path))
|
||||
local escpath = hotesc(file_path)
|
||||
table.insert( latest_path, escpath )
|
||||
|
||||
local temp = ""
|
||||
local result = ""
|
||||
|
||||
+136
-38
@@ -11,6 +11,7 @@
|
||||
.h1
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-size: 16px;
|
||||
color: var(--ifm-white);
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
@@ -22,9 +23,9 @@
|
||||
.p
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-size: 6px;
|
||||
color: var(--ifm-grey);
|
||||
margin-bottom: 45px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.href
|
||||
@@ -37,7 +38,7 @@
|
||||
{
|
||||
line-height: 16px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: 10px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
font-family: Helvetica;
|
||||
@@ -49,7 +50,7 @@
|
||||
color: var(--ifm-grey);
|
||||
line-height: 1.6em;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: 10px;
|
||||
text-decoration: none;
|
||||
background: var(--ifm-deep-black);
|
||||
display: inline-flex;
|
||||
@@ -61,19 +62,13 @@
|
||||
|
||||
.amixlink:hover
|
||||
{
|
||||
font-family: Helvetica;
|
||||
color: #000;
|
||||
line-height: 1.6em;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
background: var(--ifm-red);
|
||||
}
|
||||
|
||||
.body
|
||||
{
|
||||
width: 80%;
|
||||
padding-left: 10%;
|
||||
padding-right: 10%;
|
||||
width: 100%;
|
||||
background-color: var(--ifm-black);
|
||||
}
|
||||
|
||||
@@ -81,7 +76,7 @@
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-weight: 900;
|
||||
font-size: 16px;
|
||||
font-size: 12px;
|
||||
color: var(--ifm-grey);
|
||||
padding: 5px;
|
||||
margin-top: 2%;
|
||||
@@ -93,7 +88,15 @@
|
||||
|
||||
.prclogo
|
||||
{
|
||||
width: 1440px;
|
||||
height: 120px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.divider
|
||||
{
|
||||
height: 23px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
padding-top: 10px;
|
||||
@@ -112,7 +115,7 @@
|
||||
.header
|
||||
{
|
||||
width: 100%;
|
||||
max-height: 220px;
|
||||
max-height: 120px;
|
||||
}
|
||||
|
||||
.footer
|
||||
@@ -124,18 +127,10 @@
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-size: 18px;
|
||||
text-decoration: inherit;
|
||||
color: var(--ifm-red);
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-size: 33px;
|
||||
font-size: 18px;
|
||||
color: var(--ifm-red);
|
||||
line-height: 1em;
|
||||
z-index: 100;
|
||||
@@ -156,15 +151,9 @@
|
||||
.djsection
|
||||
{
|
||||
font-family: Helvetica;
|
||||
font-size: 33px;
|
||||
font-size: 18px;
|
||||
text-decoration: inherit;
|
||||
color: var(--ifm-red);
|
||||
line-height: 1em;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
padding-top: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.djsection:hover
|
||||
@@ -176,7 +165,7 @@
|
||||
{
|
||||
font-family: Helvetica;
|
||||
color: var(--ifm-red);
|
||||
font-size: 24px;
|
||||
font-size: 16px;
|
||||
padding-top: 5px;
|
||||
border-bottom: 2px solid var(--ifm-red);
|
||||
}
|
||||
@@ -232,10 +221,7 @@
|
||||
padding-right: 5%;
|
||||
width: 40%;
|
||||
}
|
||||
.h2
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.footer
|
||||
{
|
||||
margin-top: 15%;
|
||||
@@ -324,6 +310,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
.content
|
||||
{
|
||||
width: 80%;
|
||||
padding-left: 10%;
|
||||
padding-right: 10%;
|
||||
}
|
||||
|
||||
.latest
|
||||
{
|
||||
position: relative;
|
||||
@@ -361,10 +354,115 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:767px)
|
||||
{
|
||||
.h1mobile
|
||||
@media screen and (min-width: 600px) {
|
||||
|
||||
.h1{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.p
|
||||
{
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.mixlink
|
||||
{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.amixlink
|
||||
{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.mixsections
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.h2
|
||||
{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
max-height: 180px;
|
||||
}
|
||||
|
||||
.prclogo
|
||||
{
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.divider
|
||||
{
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.h1{
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.p
|
||||
{
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.mixlink
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.amixlink
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.mixsections
|
||||
{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.h2
|
||||
{
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
max-height: 220px;
|
||||
}
|
||||
|
||||
.prclogo
|
||||
{
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.divider
|
||||
{
|
||||
height: 43px;
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-size: 33px;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-size: 33px;
|
||||
}
|
||||
}
|
||||
|
||||
+89
-34
@@ -16,6 +16,7 @@
|
||||
.h1
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 16px;
|
||||
color: var(--ifm-red);
|
||||
border-top: 3px solid var(--ifm-red);
|
||||
border-bottom: 3px solid var(--ifm-red);
|
||||
@@ -29,9 +30,9 @@
|
||||
.p
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 6px;
|
||||
color: var(--ifm-grey);
|
||||
margin-bottom: 45px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.href
|
||||
@@ -44,7 +45,7 @@
|
||||
{
|
||||
line-height: 16px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: 10px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
font-family: ArcadeFont;
|
||||
@@ -56,7 +57,7 @@
|
||||
color: var(--ifm-grey);
|
||||
line-height: 1.6em;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: 10px;
|
||||
text-decoration: none;
|
||||
background: var(--ifm-deep-black);
|
||||
display: inline-flex;
|
||||
@@ -68,11 +69,7 @@
|
||||
|
||||
.amixlink:hover
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
color: #000;
|
||||
line-height: 1.6em;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
background: var(--ifm-red);
|
||||
}
|
||||
|
||||
@@ -88,7 +85,7 @@
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-weight: 900;
|
||||
font-size: 16px;
|
||||
font-size: 12px;
|
||||
color: var(--ifm-grey);
|
||||
padding: 5px;
|
||||
margin-top: 2%;
|
||||
@@ -109,7 +106,7 @@
|
||||
.h2
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 24px;
|
||||
font-size: 16px;
|
||||
color: var(--ifm-grey);
|
||||
font-weight: 200;
|
||||
border-bottom: 2px solid var(--ifm-grey);
|
||||
@@ -132,18 +129,10 @@
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 18px;
|
||||
text-decoration: inherit;
|
||||
color: var(--ifm-red);
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 33px;
|
||||
font-size: 18px;
|
||||
color: var(--ifm-red);
|
||||
line-height: 1em;
|
||||
z-index: 100;
|
||||
@@ -164,15 +153,9 @@
|
||||
.djsection
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
font-size: 33px;
|
||||
font-size: 18px;
|
||||
text-decoration: inherit;
|
||||
color: var(--ifm-red);
|
||||
line-height: 1em;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
padding-top: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.djsection:hover
|
||||
@@ -184,7 +167,7 @@
|
||||
{
|
||||
font-family: ArcadeFont;
|
||||
color: var(--ifm-red);
|
||||
font-size: 24px;
|
||||
font-size: 16px;
|
||||
padding-top: 5px;
|
||||
border-bottom: 2px solid var(--ifm-red);
|
||||
}
|
||||
@@ -240,10 +223,7 @@
|
||||
padding-right: 5%;
|
||||
width: 40%;
|
||||
}
|
||||
.h2
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.footer
|
||||
{
|
||||
margin-top: 15%;
|
||||
@@ -369,10 +349,85 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:767px)
|
||||
{
|
||||
.h1mobile
|
||||
@media screen and (min-width: 600px) {
|
||||
|
||||
.h1{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.p
|
||||
{
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.mixlink
|
||||
{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.amixlink
|
||||
{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.mixsections
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.h2
|
||||
{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.h1{
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.p
|
||||
{
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.mixlink
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.amixlink
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.mixsections
|
||||
{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.h2
|
||||
{
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.djsectionmenu
|
||||
{
|
||||
font-size: 33px;
|
||||
}
|
||||
|
||||
.djsection
|
||||
{
|
||||
font-size: 33px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<header class="header">
|
||||
<a href="/"><img src="/static/<%= titles['header'] %>" alt="videohotmix logo" class="hotmixlogo"/></a>
|
||||
</header>
|
||||
<h1 class="h1 h1mobile">Tons Of Mix - Downloads & Streams (right click + Save link as... for downloads)<br>
|
||||
<h1 class="h1">Tons Of Mix - Downloads & Streams (right click + Save link as... for downloads)<br>
|
||||
<%= titles.name %><br>
|
||||
Sharing <%= total[0] %> files</h1>
|
||||
|
||||
|
||||
@@ -15,18 +15,20 @@
|
||||
<header class="header">
|
||||
<a href="/"><img src="/static/<%= titles['header'] %>" alt="prc logo" class="prclogo"/></a>
|
||||
</header>
|
||||
<h1 class="h1 h1mobile">Tons Of Mix - Downloads & Streams (right click + Save link as... for downloads)<br>
|
||||
<div class="content">
|
||||
<h1 class="h1">Tons Of Mix - Downloads & Streams (right click + Save link as... for downloads)<br>
|
||||
<%= titles.name %><br>
|
||||
Sharing <%= total[0] %> files
|
||||
</h1>
|
||||
<img src="/static/panamaracing.club_divider.png">
|
||||
|
||||
</div>
|
||||
<img class="divider" src="/static/panamaracing.club_divider.png">
|
||||
<div class="content">
|
||||
<% content_for("inner") %>
|
||||
|
||||
</div>
|
||||
<img class="divider" src="/static/panamaracing.club_divider.png">
|
||||
<div class="content">
|
||||
<section class="latest">
|
||||
<div class="latest_files">
|
||||
<br>
|
||||
<br>
|
||||
<h1 class="h1">Latest uploads:</h1>
|
||||
<% for i, file in ipairs(latestpath) do %>
|
||||
<a class="amixlink" href="<%= '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %>">
|
||||
@@ -36,6 +38,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<img class="divider" src="/static/panamaracing.club_divider.png">
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
<% for i, dir in ipairs(dirs) do %>
|
||||
<br>
|
||||
<a href="<%= uri .. dir["sane"] %>" class="djsection"><span><%= dir["dir"] %></span></a>
|
||||
<a href="<%- functions.hotesc(uri .. dir) %>" class="djsection"><span><%= dir %></span></a>
|
||||
<br>
|
||||
<% end %>
|
||||
<br>
|
||||
|
||||
<% for i, file in ipairs(files) do %>
|
||||
<a class="amixlink" href="<%= path .. file["sane"] %>">
|
||||
<span class="mixlink"><%= file["file"] %></span>
|
||||
<a class="amixlink" href="<%- functions.hotesc(path .. file) %>">
|
||||
<span class="mixlink"><%= file %></span>
|
||||
</a>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
||||
<channel>
|
||||
<atom:link href="https://<%= titles['url'] %>/latest.xml" rel="self" type="application/rss+xml" />
|
||||
<title><%= titles['name'] %></title>
|
||||
<link>https://<%= titles['url'] %></link>
|
||||
<description>Latest uploads</description>
|
||||
<% for i, file in ipairs(latestpath) do %>
|
||||
<item>
|
||||
<title><%= latestname[i] %></title>
|
||||
<link><%= datapath .. file:gsub("#", "%%23") %></link>
|
||||
<description><![CDATA[<%= latestname[i] %>]]></description>
|
||||
<guid><%= datapath .. file:gsub("#", "%%23") %></guid>
|
||||
</item>
|
||||
<% end %>
|
||||
</channel>
|
||||
</rss>
|
||||
Reference in New Issue
Block a user