Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Use better names

ashilkn8541eaee6003
diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart
index be14e6ccb3..f44a3d799f 100644
--- a/mobile/lib/main.dart
+++ b/mobile/lib/main.dart
@@ -29,7 +29,6 @@ import "package:photos/l10n/l10n.dart";
import "package:photos/service_locator.dart";
import 'package:photos/services/app_lifecycle_service.dart';
import 'package:photos/services/collections_service.dart';
-import "package:photos/services/deeplink_service.dart";
import 'package:photos/services/favorites_service.dart';
import "package:photos/services/filedata/filedata_service.dart";
import 'package:photos/services/home_widget_service.dart';
@@ -213,7 +212,6 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
_logger.info("_logFGHeartBeatInfo done $tlog");
unawaited(_scheduleHeartBeat(preferences, isBackground));
NotificationService.instance.init(preferences);
- DeeplinkService.instance.init(preferences);
AppLifecycleService.instance.init(preferences);
if (isBackground) {
AppLifecycleService.instance.onAppInBackground('init via: $via $tlog');
diff --git a/mobile/lib/models/gallery_type.dart b/mobile/lib/models/gallery_type.dart
index 38746f08bb..2d9ee8adbe 100644
--- a/mobile/lib/models/gallery_type.dart
+++ b/mobile/lib/models/gallery_type.dart
@@ -295,7 +295,8 @@ extension GalleryAppBarExtn on GalleryType {
this == GalleryType.hiddenOwnedCollection) {
return true;
}
- if (this == GalleryType.sharedPublicCollection && c!.isEnableCollect()) {
+ if (this == GalleryType.sharedPublicCollection &&
+ c!.isCollectEnabledForPublicLink()) {
return true;
}
if (this == GalleryType.sharedCollection) {
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dart
index 1be6ba4976..6c0da3b5bc 100644
--- a/mobile/lib/services/collections_service.dart
+++ b/mobile/lib/services/collections_service.dart
@@ -1144,7 +1144,7 @@ class CollectionsService {
}
/// Is a public link opened in the app
- bool isSharedPublicCollection(int collectionID) {
+ bool isSharedPublicLink(int collectionID) {
return _cachedPublicCollectionID.contains(collectionID);
}
diff --git a/mobile/lib/ui/viewer/file_details/added_by_widget.dart b/mobile/lib/ui/viewer/file_details/added_by_widget.dart
index 25312347f6..3f82c51132 100644
--- a/mobile/lib/ui/viewer/file_details/added_by_widget.dart
+++ b/mobile/lib/ui/viewer/file_details/added_by_widget.dart
@@ -15,9 +15,9 @@ class AddedByWidget extends StatelessWidget {
if (!file.isUploaded) {
return const SizedBox.shrink();
}
- final bool isPublicFile = CollectionsService.instance
- .isSharedPublicCollection(file.collectionID!);
- if (isPublicFile) {
+ final bool fileIsFromSharedPublicLink =
+ CollectionsService.instance.isSharedPublicLink(file.collectionID!);
+ if (fileIsFromSharedPublicLink) {
return const SizedBox.shrink();
}
String? addedBy;
diff --git a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart
index baf2b4401e..fda19a9c1c 100644
--- a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart
+++ b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart
@@ -38,10 +38,10 @@ class GalleryFileWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isFileSelected = selectedFiles?.isFileSelected(file) ?? false;
- bool isPublicFile = false;
+ bool fileIsFromSharedPublicLink = false;
if (file.collectionID != null) {
- isPublicFile = CollectionsService.instance
- .isSharedPublicCollection(file.collectionID!);
+ fileIsFromSharedPublicLink =
+ CollectionsService.instance.isSharedPublicLink(file.collectionID!);
}
Color selectionColor = Colors.white;
if (isFileSelected && file.isUploaded && file.ownerID != currentUserID) {
@@ -59,7 +59,7 @@ class GalleryFileWidget extends StatelessWidget {
thumbnailSize: photoGridSize < photoGridSizeDefault
? thumbnailLargeSize
: thumbnailSmallSize,
- shouldShowOwnerAvatar: !(isFileSelected || isPublicFile),
+ shouldShowOwnerAvatar: !(isFileSelected || fileIsFromSharedPublicLink),
shouldShowVideoDuration: true,
);
return GestureDetector(
diff --git a/mobile/lib/utils/file_download_util.dart b/mobile/lib/utils/file_download_util.dart
index 7af50922a4..588788f4ff 100644
--- a/mobile/lib/utils/file_download_util.dart
+++ b/mobile/lib/utils/file_download_util.dart
@@ -98,7 +98,7 @@ Future<File?> downloadAndDecrypt(
ProgressCallback? progressCallback,
}) async {
if (await CollectionsService.instance
- .isSharedPublicCollection(file.collectionID!)) {
+ .isSharedPublicLink(file.collectionID!)) {
final authToken = await CollectionsService.instance
.getSharedPublicAlbumToken(file.collectionID!);
diff --git a/mobile/lib/utils/thumbnail_util.dart b/mobile/lib/utils/thumbnail_util.dart
index a1d8ed27a1..2209a28bfd 100644
--- a/mobile/lib/utils/thumbnail_util.dart
+++ b/mobile/lib/utils/thumbnail_util.dart
@@ -161,8 +161,7 @@ Future<void> _downloadAndDecryptThumbnail(FileDownloadItem item) async {
final file = item.file;
Uint8List encryptedThumbnail;
try {
- if (CollectionsService.instance
- .isSharedPublicCollection(file.collectionID!)) {
+ if (CollectionsService.instance.isSharedPublicLink(file.collectionID!)) {
final authToken = await CollectionsService.instance
.getSharedPublicAlbumToken(file.collectionID!);
final authJWTToken = await CollectionsService.instance