Skip to content

Commit

Permalink
Merge pull request #284 from takenet/release/0.2.5
Browse files Browse the repository at this point in the history
Release/0.2.5
  • Loading branch information
githubdoandre authored Nov 29, 2024
2 parents 8aabb81 + c66cde7 commit 4af3dea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.5

- [DSImageMessageBubble] Fix when channel is instagram.

## 0.2.4

- [DSSecurityService] Add service to manage security features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class DSImageMessageBubbleController extends GetxController {
}

final uri = Uri.parse(url);
final identifier = uri.queryParameters['asset_id'] ?? uri.path;

final cachePath = await DSDirectoryFormatter.getCachePath(
type: mediaType!,
filename: md5.convert(utf8.encode(uri.path)).toString(),
filename: md5.convert(utf8.encode(identifier)).toString(),
);

if (File(cachePath).existsSync()) {
Expand Down
13 changes: 10 additions & 3 deletions lib/src/controllers/chat/ds_video_message_bubble.controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DSVideoMessageBubbleController {
Future<void> getStoredVideo() async {
try {
isLoadingThumbnail.value = true;
final fileName = md5.convert(utf8.encode(Uri.parse(url).path)).toString();
final fileName = _getFileName(url);

final fullPath = await DSDirectoryFormatter.getCachePath(
type: type,
Expand All @@ -72,7 +72,7 @@ class DSVideoMessageBubbleController {
}

Future<String> getFullThumbnailPath() async {
final fileName = md5.convert(utf8.encode(Uri.parse(url).path)).toString();
final fileName = _getFileName(url);

return DSDirectoryFormatter.getCachePath(
type: 'image/png',
Expand All @@ -86,7 +86,7 @@ class DSVideoMessageBubbleController {
try {
final cachePath = await DSDirectoryFormatter.getCachePath(
type: 'video/mp4',
filename: md5.convert(utf8.encode(Uri.parse(url).path)).toString(),
filename: _getFileName(url),
);

final outputFile = File(cachePath);
Expand Down Expand Up @@ -143,4 +143,11 @@ class DSVideoMessageBubbleController {

return '${getSize(downloadProgress.value)} / ${getSize(maximumProgress.value)}';
}

String _getFileName(String url) {
final uri = Uri.parse(url);
final identifier = uri.queryParameters['asset_id'] ?? uri.path;

return md5.convert(utf8.encode(identifier)).toString();
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: blip_ds
description: Blip Design System for Flutter.
version: 0.2.4
version: 0.2.5
homepage: https://github.com/takenet/blip-ds-flutter#readme
repository: https://github.com/takenet/blip-ds-flutter

Expand Down

0 comments on commit 4af3dea

Please sign in to comment.