[mob][photos] added a new gallery type for shared public link

This commit is contained in:
Aman Raj Singh Mourya
2024-09-25 01:04:23 +05:30
parent 71e87ad2aa
commit bda3ec2e3a
3 changed files with 19 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ enum GalleryType {
quickLink,
peopleTag,
cluster,
sharedPublicLink,
}
extension GalleyTypeExtension on GalleryType {
@@ -42,6 +43,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.hiddenOwnedCollection:
case GalleryType.trash:
case GalleryType.cluster:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -65,6 +67,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.sharedCollection:
case GalleryType.locationTag:
case GalleryType.cluster:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -89,6 +92,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.hiddenSection:
case GalleryType.hiddenOwnedCollection:
case GalleryType.sharedCollection:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -111,6 +115,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.trash:
case GalleryType.cluster:
case GalleryType.sharedCollection:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -133,6 +138,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.trash:
case GalleryType.sharedCollection:
case GalleryType.quickLink:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -155,6 +161,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.cluster:
case GalleryType.trash:
case GalleryType.locationTag:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -178,6 +185,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.sharedCollection:
case GalleryType.locationTag:
case GalleryType.cluster:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -205,6 +213,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.favorite:
case GalleryType.cluster:
case GalleryType.sharedCollection:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -233,6 +242,7 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.localFolder:
case GalleryType.trash:
case GalleryType.sharedCollection:
case GalleryType.sharedPublicLink:
return false;
}
}
@@ -275,6 +285,9 @@ extension GalleryAppBarExtn on GalleryType {
this == GalleryType.hiddenOwnedCollection) {
return true;
}
if (this == GalleryType.sharedPublicLink && c!.isEnableCollect()) {
return true;
}
if (this == GalleryType.sharedCollection) {
return c?.getRole(userID) == CollectionParticipantRole.collaborator;
}
@@ -353,6 +366,7 @@ extension GalleryAppBarExtn on GalleryType {
case GalleryType.localFolder:
case GalleryType.locationTag:
case GalleryType.searchResults:
case GalleryType.sharedPublicLink:
return false;
case GalleryType.cluster:
case GalleryType.uncategorized:
@@ -368,6 +382,9 @@ extension GalleryAppBarExtn on GalleryType {
}
GalleryType getGalleryType(Collection c, int userID) {
if (c.type == CollectionType.album) {
return GalleryType.sharedPublicLink;
}
if (!c.isOwner(userID)) {
return GalleryType.sharedCollection;
}

View File

@@ -1054,6 +1054,7 @@ class CollectionsService {
final Collection collection = Collection.fromMap(collectionData);
final Uint8List collectionKey =
Uint8List.fromList(Base58Decode(albumKey));
collection.setName(_getDecryptedCollectionName(collection));
_cachedKeys[collection.id] = collectionKey;
_cachedPublicAlbumToken[collection.id] = authToken;

View File

@@ -117,8 +117,7 @@ class CollectionPage extends StatelessWidget {
_selectedFiles,
collection: c.collection,
isFromCollectPhotos: isFromCollectPhotos,
isFromPublicShareLink: isFromPublicShareLink,
files: sharedLinkFiles!,
sharedLinkFiles: sharedLinkFiles,
),
),
bottomNavigationBar: isFromCollectPhotos