[mob][photos] Use better names
This commit is contained in:
@@ -137,14 +137,14 @@ class Collection {
|
||||
return (owner?.id ?? 0) == userID;
|
||||
}
|
||||
|
||||
bool isPublicDownload() {
|
||||
bool isDownloadEnabledForPublicLink() {
|
||||
if (publicURLs == null || publicURLs!.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
return publicURLs?.first?.enableDownload ?? true;
|
||||
}
|
||||
|
||||
bool isEnableCollect() {
|
||||
bool isCollectEnabledForPublicLink() {
|
||||
if (publicURLs == null || publicURLs!.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class CollectionsService {
|
||||
final Map<String, EnteFile> _coverCache = <String, EnteFile>{};
|
||||
final Map<int, int> _countCache = <int, int>{};
|
||||
final _cachedPublicAlbumToken = <int, String>{};
|
||||
final _cachedPublicAlbumJWTToken = <int, String>{};
|
||||
final _cachedPublicAlbumJWT = <int, String>{};
|
||||
final _cachedPublicCollectionID = <int>[];
|
||||
|
||||
CollectionsService._privateConstructor() {
|
||||
@@ -180,7 +180,7 @@ class CollectionsService {
|
||||
cachedDefaultHiddenCollection = null;
|
||||
cachedUncategorizedCollection = null;
|
||||
_cachedPublicAlbumToken.clear();
|
||||
_cachedPublicAlbumJWTToken.clear();
|
||||
_cachedPublicAlbumJWT.clear();
|
||||
_cachedPublicCollectionID.clear();
|
||||
_cachedKeys.clear();
|
||||
}
|
||||
@@ -1122,8 +1122,8 @@ class CollectionsService {
|
||||
}
|
||||
|
||||
Future<String?> getPublicAlbumTokenJWT(int collectionID) async {
|
||||
if (_cachedPublicAlbumJWTToken.containsKey(collectionID)) {
|
||||
return _cachedPublicAlbumJWTToken[collectionID];
|
||||
if (_cachedPublicAlbumJWT.containsKey(collectionID)) {
|
||||
return _cachedPublicAlbumJWT[collectionID];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1133,7 +1133,7 @@ class CollectionsService {
|
||||
}
|
||||
|
||||
Future<void> setPublicAlbumTokenJWT(int collectionID, String token) async {
|
||||
_cachedPublicAlbumJWTToken[collectionID] = token;
|
||||
_cachedPublicAlbumJWT[collectionID] = token;
|
||||
}
|
||||
|
||||
Future<Collection> _fromRemoteCollection(
|
||||
|
||||
@@ -559,7 +559,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
||||
icon: Icons.delete_sweep_outlined,
|
||||
),
|
||||
if (galleryType == GalleryType.sharedPublicCollection &&
|
||||
widget.collection!.isPublicDownload())
|
||||
widget.collection!.isDownloadEnabledForPublicLink())
|
||||
EntePopupMenuItem(
|
||||
"Download album",
|
||||
value: AlbumPopupAction.downloadAlbum,
|
||||
|
||||
@@ -37,8 +37,8 @@ class SharedPublicCollectionPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final logger = Logger("SharedPublicCollectionPage");
|
||||
logger.info("Building SharedPublicCollectionPage");
|
||||
final bool isPublicDownload = c.collection.isPublicDownload();
|
||||
final bool isisEnableCollect = c.collection.isEnableCollect();
|
||||
final bool isPublicDownload = c.collection.isDownloadEnabledForPublicLink();
|
||||
final bool isisEnableCollect = c.collection.isCollectEnabledForPublicLink();
|
||||
final List<EnteFile>? initialFiles =
|
||||
c.thumbnail != null ? [c.thumbnail!] : null;
|
||||
final gallery = Gallery(
|
||||
|
||||
Reference in New Issue
Block a user