fix: correct audio file path for filesize calculation

This commit is contained in:
2025-06-04 14:01:26 +09:00
committed by Satsuki Akiba (aider)
parent 1603b2d95f
commit 1ed1bb2e1b

View File

@ -27,7 +27,9 @@ export async function updatePodcastRSS() {
for (const ep of episodes) { for (const ep of episodes) {
const fileUrl = `${baseUrl}/podcast_audio/${path.basename(ep.audioPath)}`; const fileUrl = `${baseUrl}/podcast_audio/${path.basename(ep.audioPath)}`;
const pubDate = new Date(ep.pubDate).toUTCString(); const pubDate = new Date(ep.pubDate).toUTCString();
const fileSize = fsSync.statSync(ep.audioPath).size; const fileSize = fsSync.statSync(
path.join(import.meta.dir, "public/podcast_audio", ep.audioPath),
).size;
itemsXml += ` itemsXml += `
<item> <item>
<title><![CDATA[${ep.title}]]></title> <title><![CDATA[${ep.title}]]></title>