Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Clean up

Neeraj Guptaeae5e12c7128
diff --git a/mobile/lib/core/constants.dart b/mobile/lib/core/constants.dart
index 78f3db6bad..9067d14b14 100644
--- a/mobile/lib/core/constants.dart
+++ b/mobile/lib/core/constants.dart
@@ -101,9 +101,6 @@ const blackThumbnailBase64 = '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEB'
'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'
'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgD/9k=';
-const localFileServer =
- String.fromEnvironment("localFileServer", defaultValue: "");
-
const uploadTempFilePrefix = "upload_file_";
final tempDirCleanUpInterval = kDebugMode
? const Duration(seconds: 30).inMicroseconds
diff --git a/mobile/lib/models/file/file.dart b/mobile/lib/models/file/file.dart
index ca0ef1031d..d387df708f 100644
--- a/mobile/lib/models/file/file.dart
+++ b/mobile/lib/models/file/file.dart
@@ -243,9 +243,6 @@ class EnteFile {
}
String get downloadUrl {
- if (localFileServer.isNotEmpty) {
- return "$localFileServer/$uploadedFileID";
- }
final endpoint = Configuration.instance.getHttpEndpoint();
if (endpoint != kDefaultProductionEndpoint || flagService.disableCFWorker) {
return endpoint + "/files/download/" + uploadedFileID.toString();
@@ -255,9 +252,6 @@ class EnteFile {
}
String get publicDownloadUrl {
- if (localFileServer.isNotEmpty) {
- return "$localFileServer/$uploadedFileID";
- }
final endpoint = Configuration.instance.getHttpEndpoint();
if (endpoint != kDefaultProductionEndpoint || flagService.disableCFWorker) {
return endpoint +
@@ -269,10 +263,16 @@ class EnteFile {
}
}
- String get pubPreviewUrl {
- if (localFileServer.isNotEmpty) {
- return "$localFileServer/thumb/$uploadedFileID";
+ String get thumbnailUrl {
+ final endpoint = Configuration.instance.getHttpEndpoint();
+ if (endpoint != kDefaultProductionEndpoint || flagService.disableCFWorker) {
+ return endpoint + "/files/preview/" + uploadedFileID.toString();
+ } else {
+ return "https://thumbnails.ente.io/?fileID=" + uploadedFileID.toString();
}
+ }
+
+ String get pubThumbUrl {
final endpoint = Configuration.instance.getHttpEndpoint();
if (endpoint != kDefaultProductionEndpoint || flagService.disableCFWorker) {
return endpoint +
@@ -290,18 +290,6 @@ class EnteFile {
String? debugCaption;
- String get thumbnailUrl {
- if (localFileServer.isNotEmpty) {
- return "$localFileServer/thumb/$uploadedFileID";
- }
- final endpoint = Configuration.instance.getHttpEndpoint();
- if (endpoint != kDefaultProductionEndpoint || flagService.disableCFWorker) {
- return endpoint + "/files/preview/" + uploadedFileID.toString();
- } else {
- return "https://thumbnails.ente.io/?fileID=" + uploadedFileID.toString();
- }
- }
-
String get displayName {
if (pubMagicMetadata != null && pubMagicMetadata!.editedName != null) {
return pubMagicMetadata!.editedName!;
diff --git a/mobile/lib/utils/file_download_util.dart b/mobile/lib/utils/file_download_util.dart
index 15d73f5f7f..caeb1d50ba 100644
--- a/mobile/lib/utils/file_download_util.dart
+++ b/mobile/lib/utils/file_download_util.dart
@@ -1,5 +1,4 @@
import "dart:async";
-import "dart:collection";
import 'dart:io';
import 'package:dio/dio.dart';
@@ -277,4 +276,3 @@ Future<void> _saveLivePhotoOnDroid(
);
await IgnoredFilesService.instance.cacheAndInsert([ignoreVideoFile]);
}
-}
diff --git a/mobile/lib/utils/thumbnail_util.dart b/mobile/lib/utils/thumbnail_util.dart
index 17d52c6432..1bd1d0b0c5 100644
--- a/mobile/lib/utils/thumbnail_util.dart
+++ b/mobile/lib/utils/thumbnail_util.dart
@@ -173,7 +173,7 @@ Future<void> _downloadAndDecryptThumbnail(FileDownloadItem item) async {
};
encryptedThumbnail = (await NetworkClient.instance.getDio().get(
- file.pubPreviewUrl,
+ file.pubThumbUrl,
options: Options(
headers: headers,
responseType: ResponseType.bytes,