diff --git a/frontend/src/components/EpisodePlayer.tsx b/frontend/src/components/EpisodePlayer.tsx
index ee96660..c5725b8 100644
--- a/frontend/src/components/EpisodePlayer.tsx
+++ b/frontend/src/components/EpisodePlayer.tsx
@@ -36,7 +36,7 @@ export default function EpisodePlayer() {
const handlePlay = (episode: Episode) => {
setSelectedEpisode(episode);
- setAudioUrl(`/podcast_audio/${episode.id}.mp3`);
+ setAudioUrl(`/podcast_audio/${episode.audioPath}`);
};
if (loading) return
読み込み中...
;
@@ -68,11 +68,7 @@ export default function EpisodePlayer() {
再生中: {selectedEpisode.title}
{audioUrl ? (
-
+
) : (
音声ファイルを読み込み中...
)}
diff --git a/services/podcast.ts b/services/podcast.ts
index 80a87d4..21d39a7 100644
--- a/services/podcast.ts
+++ b/services/podcast.ts
@@ -44,7 +44,7 @@ export async function updatePodcastRSS() {
}
const outputPath = join(__dirname, "../public/podcast.xml");
-
+
// 既存のRSSファイルの読み込み
let existingXml = "";
try {
@@ -56,26 +56,28 @@ export async function updatePodcastRSS() {
if (existingXml) {
// 既存のitem部分を抽出
- const existingItemsMatch = existingXml.match(/([\s\S]*?)<\/channel>/);
+ const existingItemsMatch = existingXml.match(
+ /([\s\S]*?)<\/channel>/,
+ );
if (existingItemsMatch) {
const existingItems = existingItemsMatch[1];
- const newItemStartIndex = existingItems.lastIndexOf("- ");
-
+ const newItemStartIndex = existingItems!.lastIndexOf("
- ");
+
// 新しいitemを追加
const updatedItems = existingItems + itemsXml;
-
+
// lastBuildDateを更新
const updatedXml = existingXml.replace(
/.*?<\/lastBuildDate>/,
- `${lastBuildDate}`
+ `${lastBuildDate}`,
);
-
+
// items部分を置き換え
const finalXml = updatedXml.replace(
/[\s\S]*?<\/channel>/,
- `${updatedItems}`
+ `${updatedItems}`,
);
-
+
// ファイルに書き込み
await fs.writeFile(outputPath, finalXml.trim());
} else {
@@ -106,7 +108,7 @@ export async function updatePodcastRSS() {
`;
-
+
// Ensure directory exists
await fs.mkdir(dirname(outputPath), { recursive: true });
await fs.writeFile(outputPath, rssXml.trim());
diff --git a/services/tts.ts b/services/tts.ts
index 1c06208..470748a 100644
--- a/services/tts.ts
+++ b/services/tts.ts
@@ -66,5 +66,5 @@ export async function generateTTS(
fs.writeFileSync(filePath, audioBuffer);
console.log(`音声ファイル保存完了: ${filePath}`);
- return filePath;
+ return path.basename(filePath);
}