diff --git a/CHANGELOG.md b/CHANGELOG.md index 3815b2e..78629bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.0.92 + +- Adds option to zoom in received images / videos +- Fixes issue with "reuploaded requested" not working +- Fixes race condition while writing to the log file + ## 0.0.91 - Fixes link preview on iOS diff --git a/lib/src/services/api/mediafiles/download.service.dart b/lib/src/services/api/mediafiles/download.service.dart index 8192ffe..75368ab 100644 --- a/lib/src/services/api/mediafiles/download.service.dart +++ b/lib/src/services/api/mediafiles/download.service.dart @@ -218,20 +218,11 @@ Future startDownloadMedia(MediaFile media, bool force) async { } } -int failCounter = 0; - Future downloadFileFast( MediaFile media, String apiUrl, File filePath, ) async { - if (failCounter < 2) { - failCounter += 1; - await requestMediaReupload(media.mediaId); - return; - } - failCounter = 0; - final response = await http.get(Uri.parse(apiUrl)).timeout(const Duration(seconds: 10)); diff --git a/lib/src/services/api/mediafiles/upload.service.dart b/lib/src/services/api/mediafiles/upload.service.dart index b1b6073..7dd4f20 100644 --- a/lib/src/services/api/mediafiles/upload.service.dart +++ b/lib/src/services/api/mediafiles/upload.service.dart @@ -378,7 +378,7 @@ Future uploadFileFastOrEnqueue( try { Log.info('Uploading fast: ${task.taskId}'); final response = - await requestMultipart.send().timeout(const Duration(seconds: 4)); + await requestMultipart.send().timeout(const Duration(seconds: 8)); var status = TaskStatus.failed; if (response.statusCode == 200) { status = TaskStatus.complete; diff --git a/lib/src/views/chats/media_viewer.view.dart b/lib/src/views/chats/media_viewer.view.dart index c20edfd..43642af 100644 --- a/lib/src/views/chats/media_viewer.view.dart +++ b/lib/src/views/chats/media_viewer.view.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:lottie/lottie.dart'; import 'package:no_screenshot/no_screenshot.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:twonly/globals.dart'; import 'package:twonly/src/database/daos/contacts.dao.dart'; import 'package:twonly/src/database/tables/mediafiles.table.dart' @@ -536,15 +537,22 @@ class _MediaViewerViewState extends State { children: [ if (videoController != null) Positioned.fill( - child: VideoPlayer(videoController!), + child: PhotoView.customChild( + initialScale: PhotoViewComputedScale.contained, + minScale: PhotoViewComputedScale.contained, + child: VideoPlayer(videoController!), + ), ) else if (currentMedia != null && currentMedia!.mediaFile.type == MediaType.image || currentMedia!.mediaFile.type == MediaType.gif) Positioned.fill( - child: Image.file( - currentMedia!.tempPath, - fit: BoxFit.contain, + child: PhotoView( + imageProvider: FileImage( + currentMedia!.tempPath, + ), + initialScale: PhotoViewComputedScale.contained, + minScale: PhotoViewComputedScale.contained, ), ), ], diff --git a/lib/src/views/memories/memories_photo_slider.view.dart b/lib/src/views/memories/memories_photo_slider.view.dart index 4ac7d35..a44dbec 100644 --- a/lib/src/views/memories/memories_photo_slider.view.dart +++ b/lib/src/views/memories/memories_photo_slider.view.dart @@ -242,7 +242,6 @@ class _MemoriesPhotoSliderViewState extends State { child: VideoPlayerWrapper( videoPath: filePath, ), - // childSize: const Size(300, 300), initialScale: PhotoViewComputedScale.contained, minScale: PhotoViewComputedScale.contained, maxScale: PhotoViewComputedScale.covered * 4.1,