Merge branch 'main' into homewidget
This commit is contained in:
@@ -1372,10 +1372,10 @@ class CollectionsService {
|
||||
}
|
||||
|
||||
Future<void> move(
|
||||
int toCollectionID,
|
||||
int fromCollectionID,
|
||||
List<EnteFile> files,
|
||||
) async {
|
||||
List<EnteFile> files, {
|
||||
required int toCollectionID,
|
||||
required int fromCollectionID,
|
||||
}) async {
|
||||
_validateMoveRequest(toCollectionID, fromCollectionID, files);
|
||||
files.removeWhere((element) => element.uploadedFileID == null);
|
||||
if (files.isEmpty) {
|
||||
@@ -1443,9 +1443,19 @@ class CollectionsService {
|
||||
int fromCollectionID,
|
||||
List<EnteFile> files,
|
||||
) {
|
||||
final int userID = Configuration.instance.getUserID()!;
|
||||
if (toCollectionID == fromCollectionID) {
|
||||
throw AssertionError("Can't move to same album");
|
||||
}
|
||||
final Collection? toCollection = _collectionIDToCollections[toCollectionID];
|
||||
final Collection? fromCollection =
|
||||
_collectionIDToCollections[fromCollectionID];
|
||||
if (toCollection != null && !toCollection.isOwner(userID)) {
|
||||
throw AssertionError("Can't move to a collection you don't own");
|
||||
}
|
||||
if (fromCollection != null && !fromCollection.isOwner(userID)) {
|
||||
throw AssertionError("Can't move from a collection you don't own");
|
||||
}
|
||||
for (final file in files) {
|
||||
if (file.uploadedFileID == null) {
|
||||
throw AssertionError("Can only move uploaded memories");
|
||||
|
||||
@@ -57,21 +57,25 @@ extension HiddenService on CollectionsService {
|
||||
Future<Collection> clubAllDefaultHiddenToOne(
|
||||
List<Collection> allDefaultHidden,
|
||||
) async {
|
||||
final Collection result = allDefaultHidden.first;
|
||||
|
||||
for (Collection defaultHidden in allDefaultHidden) {
|
||||
// select first collection as default hidden where all files will be clubbed
|
||||
final Collection defaultHidden = allDefaultHidden.first;
|
||||
for (Collection hidden in allDefaultHidden) {
|
||||
try {
|
||||
if (defaultHidden.id == result.id) {
|
||||
if (hidden.id == defaultHidden.id) {
|
||||
continue;
|
||||
}
|
||||
final filesInCollection = (await FilesDB.instance.getFilesInCollection(
|
||||
defaultHidden.id,
|
||||
hidden.id,
|
||||
galleryLoadStartTime,
|
||||
galleryLoadEndTime,
|
||||
))
|
||||
.files;
|
||||
await move(result.id, defaultHidden.id, filesInCollection);
|
||||
await CollectionsService.instance.trashEmptyCollection(defaultHidden);
|
||||
await move(
|
||||
filesInCollection,
|
||||
toCollectionID: defaultHidden.id,
|
||||
fromCollectionID: hidden.id,
|
||||
);
|
||||
await CollectionsService.instance.trashEmptyCollection(hidden);
|
||||
} catch (e, s) {
|
||||
_logger.severe(
|
||||
"One iteration of clubbing all default hidden failed",
|
||||
@@ -82,7 +86,7 @@ extension HiddenService on CollectionsService {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return defaultHidden;
|
||||
}
|
||||
|
||||
// getUncategorizedCollection will return the uncategorized collection
|
||||
@@ -137,7 +141,18 @@ extension HiddenService on CollectionsService {
|
||||
_logger.finest('file already part of hidden collection');
|
||||
continue;
|
||||
}
|
||||
await move(defaultHiddenCollection.id, entry.key, entry.value);
|
||||
final Collection? c = getCollectionByID(entry.key);
|
||||
// if the collection is not owned by the user, remove the file from the
|
||||
// collection
|
||||
if (c != null && !c.isOwner(userID)) {
|
||||
await removeFromCollection(entry.key, entry.value);
|
||||
} else {
|
||||
await move(
|
||||
entry.value,
|
||||
toCollectionID: defaultHiddenCollection.id,
|
||||
fromCollectionID: entry.key,
|
||||
);
|
||||
}
|
||||
}
|
||||
Bus.instance.fire(
|
||||
LocalPhotosUpdatedEvent(
|
||||
|
||||
@@ -41,9 +41,14 @@ class MachineLearningController {
|
||||
}
|
||||
|
||||
void onUserInteraction() {
|
||||
_logger.info("User is interacting with the app");
|
||||
_isUserInteracting = true;
|
||||
_fireControlEvent();
|
||||
if (Platform.isIOS) {
|
||||
return;
|
||||
}
|
||||
if (!_isUserInteracting) {
|
||||
_logger.info("User is interacting with the app");
|
||||
_isUserInteracting = true;
|
||||
_fireControlEvent();
|
||||
}
|
||||
_resetTimer();
|
||||
}
|
||||
|
||||
|
||||
@@ -558,9 +558,9 @@ class CollectionActions {
|
||||
);
|
||||
} else {
|
||||
await collectionsService.move(
|
||||
entry.key,
|
||||
collection.id,
|
||||
entry.value,
|
||||
toCollectionID: entry.key,
|
||||
fromCollectionID: collection.id,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,9 +398,9 @@ class AlbumVerticalListWidget extends StatelessWidget {
|
||||
try {
|
||||
final int fromCollectionID = selectedFiles!.files.first.collectionID!;
|
||||
await CollectionsService.instance.move(
|
||||
toCollectionID,
|
||||
fromCollectionID,
|
||||
selectedFiles!.files.toList(),
|
||||
toCollectionID: toCollectionID,
|
||||
fromCollectionID: fromCollectionID,
|
||||
);
|
||||
await dialog.hide();
|
||||
unawaited(RemoteSyncService.instance.sync(silently: true));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
import 'package:photos/services/feature_flag_service.dart';
|
||||
import 'package:photos/services/update_service.dart';
|
||||
import "package:photos/ui/payment/store_subscription_page.dart";
|
||||
@@ -8,9 +9,18 @@ StatefulWidget getSubscriptionPage({bool isOnBoarding = false}) {
|
||||
if (UpdateService.instance.isIndependentFlavor()) {
|
||||
return StripeSubscriptionPage(isOnboarding: isOnBoarding);
|
||||
}
|
||||
if (FeatureFlagService.instance.enableStripe()) {
|
||||
if (FeatureFlagService.instance.enableStripe() &&
|
||||
_isUserCreatedPostStripeSupport()) {
|
||||
return StripeSubscriptionPage(isOnboarding: isOnBoarding);
|
||||
} else {
|
||||
return StoreSubscriptionPage(isOnboarding: isOnBoarding);
|
||||
}
|
||||
}
|
||||
|
||||
// return true if the user was created after we added support for stripe payment
|
||||
// on frame. We do this check to avoid showing Stripe payment option for earlier
|
||||
// users who might have paid via playStore. This method should be removed once
|
||||
// we have better handling for active play/app store subscription & stripe plans.
|
||||
bool _isUserCreatedPostStripeSupport() {
|
||||
return Configuration.instance.getUserID()! > 1580559962386460;
|
||||
}
|
||||
|
||||
@@ -42,14 +42,16 @@ class _LogFileViewerState extends State<LogFileViewer> {
|
||||
}
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(left: 12, top: 8, right: 12),
|
||||
child: SingleChildScrollView(
|
||||
child: Text(
|
||||
_logs!,
|
||||
style: const TextStyle(
|
||||
fontFeatures: [
|
||||
FontFeature.tabularFigures(),
|
||||
],
|
||||
height: 1.2,
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
child: Text(
|
||||
_logs!,
|
||||
style: const TextStyle(
|
||||
fontFeatures: [
|
||||
FontFeature.tabularFigures(),
|
||||
],
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1397,8 +1397,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: HEAD
|
||||
resolved-ref: "1318dce97f3aae5ec9bdf7491d5eff0ad6beb378"
|
||||
ref: "5f26aef45ed9f5e563c26f90c1e21b3339ed906d"
|
||||
resolved-ref: "5f26aef45ed9f5e563c26f90c1e21b3339ed906d"
|
||||
url: "https://github.com/ente-io/onnxruntime.git"
|
||||
source: git
|
||||
version: "1.1.0"
|
||||
|
||||
@@ -12,7 +12,7 @@ description: ente photos application
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
|
||||
version: 0.8.61+581
|
||||
version: 0.8.64+584
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
@@ -121,7 +121,9 @@ dependencies:
|
||||
|
||||
# open_file: ^3.2.1
|
||||
onnxruntime:
|
||||
git: "https://github.com/ente-io/onnxruntime.git"
|
||||
git:
|
||||
url: https://github.com/ente-io/onnxruntime.git
|
||||
ref: 5f26aef45ed9f5e563c26f90c1e21b3339ed906d
|
||||
open_mail_app: ^0.4.5
|
||||
package_info_plus: ^4.1.0
|
||||
page_transition: ^2.0.2
|
||||
|
||||
Reference in New Issue
Block a user