refactor url+path generation

This commit is contained in:
dreamer 2026-03-26 14:43:50 +01:00
parent 52cca8eef2
commit e9d4163a5d
2 changed files with 3 additions and 6 deletions

View File

@ -10,10 +10,7 @@ local function RSShandler(self)
local latest_path, latest_name = hotmixes.utils.these_latest( path ) local latest_path, latest_name = hotmixes.utils.these_latest( path )
local host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host local host = self.req.parsed_url.scheme .. '://' .. self.req.parsed_url.host
local data_path = host .. '/data/' .. self.titles.url .. '/' self.datapath = host .. '/data/' .. self.titles.url .. '/'
local latest_json = {}
latest_json["files"] = {}
self.latestpath = latest_path self.latestpath = latest_path
self.latestname = latest_name self.latestname = latest_name

View File

@ -9,9 +9,9 @@
<% for i, file in ipairs(latestpath) do %> <% for i, file in ipairs(latestpath) do %>
<item> <item>
<title><%= latestname[i] %></title> <title><%= latestname[i] %></title>
<link><%= 'https://' .. titles.url .. '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %></link> <link><%= datapath .. '/' .. file:gsub("#", "%%23") %></link>
<description><![CDATA[<%= latestname[i] %>]]></description> <description><![CDATA[<%= latestname[i] %>]]></description>
<guid><%= 'https://' .. titles.url .. '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %></guid> <guid><%= datapath .. '/' .. file:gsub("#", "%%23") %></guid>
</item> </item>
<% end %> <% end %>
</channel> </channel>