fix story bug

This commit is contained in:
zyc 2026-02-12 14:06:34 +08:00
parent 1140d2c440
commit 86d1b77fa7
2 changed files with 191 additions and 174 deletions

View File

@ -101,9 +101,26 @@ class _StoryDetailPageState extends State<StoryDetailPage>
setState(() => _audioDuration = dur);
});
// Check if audio already exists (via TTSService)
// Check if audio already exists
debugPrint('[StoryDetail] story keys: ${_currentStory.keys.toList()}');
debugPrint('[StoryDetail] audio_url value: "${_currentStory['audio_url']}"');
debugPrint('[StoryDetail] id value: ${_currentStory['id']}');
final title = _currentStory['title'] as String? ?? '';
_ttsService.checkExistingAudio(title);
final audioUrl = _currentStory['audio_url'] as String? ?? '';
final storyId = _currentStory['id'] as int?;
debugPrint('[StoryDetail] parsed: title=$title, audioUrl=$audioUrl, storyId=$storyId');
if (audioUrl.isNotEmpty) {
debugPrint('[StoryDetail] -> setExistingAudio');
_ttsService.setExistingAudio(title, audioUrl);
} else if (storyId != null) {
debugPrint('[StoryDetail] -> checkExistingAudio');
_ttsService.checkExistingAudio(title, storyId: storyId);
} else {
debugPrint('[StoryDetail] -> no audio, no storyId');
}
}
void _onTTSChanged() {

File diff suppressed because it is too large Load Diff