Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Fix the transcript download prompt failing on a streamed podcast episode

Barnabas3eef6e17c5b7
diff --git a/lib/services/download_service.dart b/lib/services/download_service.dart
index 124ec872..a59913e6 100644
--- a/lib/services/download_service.dart
+++ b/lib/services/download_service.dart
@@ -1331,6 +1331,14 @@ class DownloadService extends ChangeNotifier {
bool automatic = false,
}) async {
if (shouldStart?.call() == false) return null;
+ // Episodes are keyed "podcastId-episodeId" everywhere below. A caller
+ // holding the bare podcast id (the transcription download prompt did)
+ // used to fail in the key math before a single request went out.
+ if (episodeId != null && !itemId.endsWith('-$episodeId')) {
+ debugPrint('[Download] "$title": composing the episode key from '
+ 'podcast $itemId + episode $episodeId');
+ itemId = '$itemId-$episodeId';
+ }
try {
await init().timeout(const Duration(seconds: 8));
} on TimeoutException catch (e) {