Skip to content

Commit

Permalink
fix: attempt fix for thumbnail downloading partial data and saving if…
Browse files Browse the repository at this point in the history
… connection lost
  • Loading branch information
MSOB7YY committed Nov 5, 2024
1 parent bef2981 commit 0508392
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/controller/thumbnail_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,9 @@ class _YTThumbnailDownloadManager with PortsProvider<SendPort> {
if (notfound == true) throw Exception('not found'); // as if request failed.

File? newFile;

final downloadStream = response.asBroadcastStream();
await for (final e in downloadStream) {
fileStream.add(e);
}
await fileStream.addStream(downloadStream); // this should throw if connection closed unexpectedly
await fileStream.flush();
await fileStream.close(); // this is already done by diposeIdRequestResources() but we do here bcz renaming can require that no processes are using the file

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 4.6.63-beta+241105210
version: 4.6.64-beta+241105210

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit 0508392

Please sign in to comment.