fix story bug
This commit is contained in:
parent
1140d2c440
commit
86d1b77fa7
@ -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
Loading…
x
Reference in New Issue
Block a user