Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into independent
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 committed Dec 19, 2022
2 parents 20f6fb0 + c0370e2 commit 6a74258
Show file tree
Hide file tree
Showing 89 changed files with 4,602 additions and 922 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

We have open-source apps across Android, iOS, web and desktop that automatically backup your photos and videos.

This repository contains the code for our mobile apps, built with a lot of ❤️, and a little bit of [Flutter.](https://flutter.dev)
This repository contains the code for our mobile apps, built with a lot of ❤️, and a little bit of [Flutter](https://flutter.dev).

![App Screenshots](https://user-images.githubusercontent.com/24503581/175218240-fe5a0703-82c1-4750-bfea-abfd9f409a97.png)

Expand Down Expand Up @@ -35,7 +35,11 @@ This repository contains the code for our mobile apps, built with a lot of ❤

### Android

This [repository's GitHub releases](https://github.com/ente-io/frame/releases) contains APKs, built straight from source. The latest build is available @ [ente.io/apk](https://ente.io/apk). These builds keep themselves updated, without relying on third party stores.
This [repository's GitHub
releases](https://github.com/ente-io/photos-app/releases) contains APKs, built
straight from source. The latest build is available @
[ente.io/apk](https://ente.io/apk). These builds keep themselves updated,
without relying on third party stores.

You can alternatively install the build from PlayStore or F-Droid.

Expand All @@ -58,10 +62,10 @@ You can alternatively install the build from PlayStore or F-Droid.
## 🧑‍💻 Building from source

1. [Install Flutter](https://flutter.dev/docs/get-started/install)
2. Clone this repository with `git clone [email protected]:ente-io/frame.git`
2. Clone this repository with `git clone [email protected]:ente-io/photos-app.git`
3. Pull in all submodules with `git submodule update --init --recursive`
4. For Android, run `flutter build apk --release --flavor independent`
5. For iOS, run `flutter build ios`
5. For iOS, run `flutter build ios`

<br/>

Expand All @@ -81,7 +85,8 @@ We maintain a public roadmap, that's driven by our community @ [roadmap.ente.io]

If you like this project, please consider upgrading to a paid subscription.

If you would like to motivate us to keep building, you can do so by [starring](https://github.com/ente-io/frame/stargazers) this project.
If you would like to motivate us to keep building, you can do so by
[starring](https://github.com/ente-io/photos-app/stargazers) this project.

<br/>

Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FEATURES
- and a LOT more!

PERMISSIONS
Ente requests for certain permissions to serve the purpose of a photo storage provider, which can be reviewed here: https://github.com/ente-io/frame/blob/f-droid/android/permissions.md
Ente requests for certain permissions to serve the purpose of a photo storage provider, which can be reviewed here: https://github.com/ente-io/photos-app/blob/f-droid/android/permissions.md

PRICING
We don't offer forever free plans, because it is important to us that we remain sustainable and withstand the test of time. Instead we offer affordable plans that you can freely share with your family. You can find more information at ente.io.
Expand Down
9 changes: 8 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ PODS:
- Flutter
- in_app_purchase_storekit (0.0.1):
- Flutter
- keyboard_visibility (0.5.0):
- Flutter
- Reachability
- libwebp (1.2.3):
- libwebp/demux (= 1.2.3)
- libwebp/mux (= 1.2.3)
Expand Down Expand Up @@ -195,6 +198,7 @@ DEPENDENCIES:
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_editor (from `.symlinks/plugins/image_editor/ios`)
- in_app_purchase_storekit (from `.symlinks/plugins/in_app_purchase_storekit/ios`)
- keyboard_visibility (from `.symlinks/plugins/keyboard_visibility/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- media_extension (from `.symlinks/plugins/media_extension/ios`)
- motionphoto (from `.symlinks/plugins/motionphoto/ios`)
Expand Down Expand Up @@ -274,6 +278,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_editor/ios"
in_app_purchase_storekit:
:path: ".symlinks/plugins/in_app_purchase_storekit/ios"
keyboard_visibility:
:path: ".symlinks/plugins/keyboard_visibility/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
media_extension:
Expand Down Expand Up @@ -326,7 +332,7 @@ SPEC CHECKSUMS:
FirebaseInstallations: 0a115432c4e223c5ab20b0dbbe4cbefa793a0e8e
FirebaseMessaging: 732623518591384f61c287e3d8f65294beb7ffb3
fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b
flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
Expand All @@ -341,6 +347,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 1d20a6ad97ef46f67bbdec158ce00563a671ebb7
image_editor: eab82a302a6623a866da5145b7c4c0ee8a4ffbb4
in_app_purchase_storekit: d7fcf4646136ec258e237872755da8ea6c1b6096
keyboard_visibility: 96a24de806fe6823c3ad956c01ba2ec6d056616f
libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
"${BUILT_PRODUCTS_DIR}/image_editor/image_editor.framework",
"${BUILT_PRODUCTS_DIR}/in_app_purchase_storekit/in_app_purchase_storekit.framework",
"${BUILT_PRODUCTS_DIR}/keyboard_visibility/keyboard_visibility.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
"${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework",
"${BUILT_PRODUCTS_DIR}/media_extension/media_extension.framework",
Expand Down Expand Up @@ -342,6 +343,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_editor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/in_app_purchase_storekit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/keyboard_visibility.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/media_extension.framework",
Expand Down
5 changes: 5 additions & 0 deletions lib/core/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const int batchSize = 1000;
const photoGridSizeDefault = 4;
const photoGridSizeMin = 2;
const photoGridSizeMax = 6;
const subGalleryLimitDefault = 80;
const subGalleryLimitMin = 40;

// used to identify which ente file are available in app cache
// todo: 6Jun22: delete old media identifier after 3 months
Expand Down Expand Up @@ -49,3 +51,6 @@ class FFDefault {
const kDefaultProductionEndpoint = 'https://api.ente.io';

const int intMaxValue = 9223372036854775807;

//Screen width of iPhone 14 pro max in points is taken as maximum
const double restrictedMaxWidth = 430;
12 changes: 0 additions & 12 deletions lib/db/files_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -817,18 +817,6 @@ class FilesDB {
);
}

Future<int> getNumberOfUploadedFiles() async {
final db = await instance.database;
final rows = await db.query(
filesTable,
columns: [columnUploadedFileID],
where:
'($columnLocalID IS NOT NULL AND ($columnUploadedFileID IS NOT NULL AND $columnUploadedFileID IS NOT -1) AND $columnUpdationTime IS NOT NULL)',
distinct: true,
);
return rows.length;
}

Future<int> updateUploadedFile(
String localID,
String title,
Expand Down
3 changes: 3 additions & 0 deletions lib/ente_theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ extension CustomColorScheme on ColorScheme {

EnteTheme get enteTheme =>
brightness == Brightness.light ? lightTheme : darkTheme;

EnteTheme get inverseEnteTheme =>
brightness == Brightness.light ? darkTheme : lightTheme;
}

OutlinedButtonThemeData buildOutlinedButtonThemeData({
Expand Down
12 changes: 12 additions & 0 deletions lib/extensions/string_ext.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extension StringExtensionsNullSafe on String? {
int get sumAsciiValues {
if (this == null) {
return -1;
}
int sum = 0;
for (int i = 0; i < this!.length; i++) {
sum += this!.codeUnitAt(i);
}
return sum;
}
}
61 changes: 56 additions & 5 deletions lib/models/collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@ class Collection {
return (magicMetadata.subType ?? 0) == subTypeDefaultHidden;
}

List<User> getSharees() {
final List<User> result = [];
if (sharees == null) {
return result;
}
for (final User? u in sharees!) {
if (u != null) {
result.add(u);
}
}
return result;
}

bool isOwner(int userID) {
return (owner?.id ?? 0) == userID;
}

void updateSharees(List<User> newSharees) {
sharees?.clear();
sharees?.addAll(newSharees);
}

static CollectionType typeFromString(String type) {
switch (type) {
case "folder":
Expand Down Expand Up @@ -168,6 +190,31 @@ enum CollectionType {
album,
}

enum CollectionParticipantRole {
unknown,
viewer,
collaborator,
owner,
}

extension CollectionParticipantRoleExtn on CollectionParticipantRole {
static CollectionParticipantRole fromString(String? val) {
if ((val ?? '') == '') {
return CollectionParticipantRole.viewer;
}
for (var x in CollectionParticipantRole.values) {
if (x.name.toUpperCase() == val!.toUpperCase()) {
return x;
}
}
return CollectionParticipantRole.unknown;
}

String toStringVal() {
return name.toUpperCase();
}
}

class CollectionAttributes {
final String? encryptedPath;
final String? pathDecryptionNonce;
Expand Down Expand Up @@ -206,19 +253,22 @@ class User {
int? id;
String email;
String? name;
String? role;

User({
this.id,
required this.email,
this.name,
this.role,
});

bool get isViewer => role == null || role?.toUpperCase() == 'VIEWER';

bool get isCollaborator =>
role != null && role?.toUpperCase() == 'COLLABORATOR';

Map<String, dynamic> toMap() {
return {
'id': id,
'email': email,
'name': name,
};
return {'id': id, 'email': email, 'name': name, 'role': role};
}

static fromMap(Map<String, dynamic>? map) {
Expand All @@ -228,6 +278,7 @@ class User {
id: map['id'],
email: map['email'],
name: map['name'],
role: map['role'] ?? 'VIEWER',
);
}

Expand Down
Loading

0 comments on commit 6a74258

Please sign in to comment.