refactor: use unique ID for audio file and episode

This commit is contained in:
2025-06-04 14:32:07 +09:00
committed by Satsuki Akiba (aider)
parent 1d6a6e1ee6
commit 93d87c5997
2 changed files with 4 additions and 4 deletions

View File

@ -82,9 +82,9 @@ async function main() {
.createHash("md5")
.update(category)
.digest("hex");
const uniqueFilename = `${feedUrlHash}-${categoryHash}.wav`;
const uniqueId = `${feedUrlHash}-${categoryHash}.wav`;
const audioFilePath = await generateTTS(uniqueFilename, podcastContent);
const audioFilePath = await generateTTS(uniqueId, podcastContent);
console.log(`音声ファイル生成完了: ${audioFilePath}`);
// エピソードとして保存各フィードにつき1つの統合エピソード
@ -96,7 +96,7 @@ async function main() {
const pub = new Date(firstItem.pubDate || "");
await saveEpisode({
id: `topic-${categoryHash}`,
id: uniqueId,
title: `${category}: ${feedTitle}`,
pubDate: pub.toISOString(),
audioPath: audioFilePath,