Compare commits
2 Commits
rust_proce
...
leap_of_fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e0eb9303f | ||
|
|
e1aee3cfbd |
@@ -71,9 +71,9 @@ android {
|
|||||||
dimension "default"
|
dimension "default"
|
||||||
applicationIdSuffix ".dev"
|
applicationIdSuffix ".dev"
|
||||||
}
|
}
|
||||||
face {
|
offline {
|
||||||
dimension "default"
|
dimension "default"
|
||||||
applicationIdSuffix ".face"
|
applicationIdSuffix ".offline"
|
||||||
}
|
}
|
||||||
playstore {
|
playstore {
|
||||||
dimension "default"
|
dimension "default"
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">Ente Face</string>
|
|
||||||
<string name="backup">backup face</string>
|
|
||||||
</resources>
|
|
||||||
4
mobile/android/app/src/offline/res/values/strings.xml
Normal file
4
mobile/android/app/src/offline/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">Ente Offline</string>
|
||||||
|
<string name="backup">backup Offline</string>
|
||||||
|
</resources>
|
||||||
@@ -78,8 +78,8 @@ class LocalSyncService {
|
|||||||
return _existingSync!.future;
|
return _existingSync!.future;
|
||||||
}
|
}
|
||||||
_existingSync = Completer<void>();
|
_existingSync = Completer<void>();
|
||||||
final int ownerID = Configuration.instance.getUserID()!;
|
final int ownerID = Configuration.instance.getUserID() ?? 0;
|
||||||
|
|
||||||
// We use a lock to prevent synchronisation to occur while it is downloading
|
// We use a lock to prevent synchronisation to occur while it is downloading
|
||||||
// as this introduces wrong entry in FilesDB due to race condition
|
// as this introduces wrong entry in FilesDB due to race condition
|
||||||
// This is a fix for https://github.com/ente-io/ente/issues/4296
|
// This is a fix for https://github.com/ente-io/ente/issues/4296
|
||||||
@@ -98,7 +98,8 @@ class LocalSyncService {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Load from 0 - 01.01.2010
|
// Load from 0 - 01.01.2010
|
||||||
Bus.instance.fire(SyncStatusUpdate(SyncStatus.startedFirstGalleryImport));
|
Bus.instance
|
||||||
|
.fire(SyncStatusUpdate(SyncStatus.startedFirstGalleryImport));
|
||||||
var startTime = 0;
|
var startTime = 0;
|
||||||
var toYear = 2010;
|
var toYear = 2010;
|
||||||
var toTime = DateTime(toYear).microsecondsSinceEpoch;
|
var toTime = DateTime(toYear).microsecondsSinceEpoch;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import "package:battery_info/battery_info_plugin.dart";
|
|||||||
import "package:battery_info/model/android_battery_info.dart";
|
import "package:battery_info/model/android_battery_info.dart";
|
||||||
import "package:battery_info/model/iso_battery_info.dart";
|
import "package:battery_info/model/iso_battery_info.dart";
|
||||||
import "package:logging/logging.dart";
|
import "package:logging/logging.dart";
|
||||||
|
import "package:photos/core/configuration.dart";
|
||||||
import "package:photos/core/event_bus.dart";
|
import "package:photos/core/event_bus.dart";
|
||||||
import "package:photos/events/machine_learning_control_event.dart";
|
import "package:photos/events/machine_learning_control_event.dart";
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ class MachineLearningController {
|
|||||||
bool get isDeviceHealthy => _isDeviceHealthy;
|
bool get isDeviceHealthy => _isDeviceHealthy;
|
||||||
|
|
||||||
MachineLearningController() {
|
MachineLearningController() {
|
||||||
|
if (Configuration.instance.getUserID() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_logger.info('MachineLearningController constructor');
|
_logger.info('MachineLearningController constructor');
|
||||||
_startInteractionTimer(kDefaultInteractionTimeout);
|
_startInteractionTimer(kDefaultInteractionTimeout);
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
@@ -45,6 +49,9 @@ class MachineLearningController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onUserInteraction() {
|
void onUserInteraction() {
|
||||||
|
if (Configuration.instance.getUserID() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!_isUserInteracting) {
|
if (!_isUserInteracting) {
|
||||||
_logger.info("User is interacting with the app");
|
_logger.info("User is interacting with the app");
|
||||||
_isUserInteracting = true;
|
_isUserInteracting = true;
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class _HomeGalleryWidgetState extends State<HomeGalleryWidget> {
|
|||||||
final gallery = Gallery(
|
final gallery = Gallery(
|
||||||
key: ValueKey(_shouldHideSharedItems),
|
key: ValueKey(_shouldHideSharedItems),
|
||||||
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
|
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
|
||||||
final ownerID = Configuration.instance.getUserID();
|
final ownerID = Configuration.instance.getUserID() ?? 0;
|
||||||
final hasSelectedAllForBackup =
|
final hasSelectedAllForBackup =
|
||||||
Configuration.instance.hasSelectedAllFoldersForBackup();
|
Configuration.instance.hasSelectedAllFoldersForBackup();
|
||||||
final collectionsToHide =
|
final collectionsToHide =
|
||||||
@@ -89,7 +89,7 @@ class _HomeGalleryWidgetState extends State<HomeGalleryWidget> {
|
|||||||
ignoredCollectionIDs: collectionsToHide,
|
ignoredCollectionIDs: collectionsToHide,
|
||||||
ignoreSavedFiles: true,
|
ignoreSavedFiles: true,
|
||||||
);
|
);
|
||||||
if (hasSelectedAllForBackup) {
|
if (hasSelectedAllForBackup || ownerID == 0) {
|
||||||
result = await FilesDB.instance.getAllLocalAndUploadedFiles(
|
result = await FilesDB.instance.getAllLocalAndUploadedFiles(
|
||||||
creationStartTime,
|
creationStartTime,
|
||||||
creationEndTime,
|
creationEndTime,
|
||||||
|
|||||||
@@ -638,15 +638,18 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isOfflineMode = true;
|
||||||
Widget _getBody(BuildContext context) {
|
Widget _getBody(BuildContext context) {
|
||||||
if (!Configuration.instance.hasConfiguredAccount()) {
|
if (!Configuration.instance.hasConfiguredAccount() && !isOfflineMode) {
|
||||||
_closeDrawerIfOpen(context);
|
_closeDrawerIfOpen(context);
|
||||||
return const LandingPageWidget();
|
return const LandingPageWidget();
|
||||||
}
|
}
|
||||||
if (!LocalSyncService.instance.hasGrantedPermissions()) {
|
if (!LocalSyncService.instance.hasGrantedPermissions()) {
|
||||||
entityService.syncEntities().then((_) {
|
if (isOfflineMode) {
|
||||||
PersonService.instance.resetEmailToPartialPersonDataCache();
|
entityService.syncEntities().then((_) {
|
||||||
});
|
PersonService.instance.resetEmailToPartialPersonDataCache();
|
||||||
|
});
|
||||||
|
}
|
||||||
return const GrantPermissionsWidget();
|
return const GrantPermissionsWidget();
|
||||||
}
|
}
|
||||||
if (!LocalSyncService.instance.hasCompletedFirstImport()) {
|
if (!LocalSyncService.instance.hasCompletedFirstImport()) {
|
||||||
@@ -672,7 +675,8 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||||||
_showShowBackupHook =
|
_showShowBackupHook =
|
||||||
!Configuration.instance.hasSelectedAnyBackupFolder() &&
|
!Configuration.instance.hasSelectedAnyBackupFolder() &&
|
||||||
!LocalSyncService.instance.hasGrantedLimitedPermissions() &&
|
!LocalSyncService.instance.hasGrantedLimitedPermissions() &&
|
||||||
CollectionsService.instance.getActiveCollections().isEmpty;
|
CollectionsService.instance.getActiveCollections().isEmpty &&
|
||||||
|
!isOfflineMode;
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -694,15 +698,17 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||||||
_showShowBackupHook
|
_showShowBackupHook
|
||||||
? const StartBackupHookWidget(headerWidget: HeaderWidget())
|
? const StartBackupHookWidget(headerWidget: HeaderWidget())
|
||||||
: HomeGalleryWidget(
|
: HomeGalleryWidget(
|
||||||
header: const HeaderWidget(),
|
header: isOfflineMode
|
||||||
|
? const SizedBox.shrink()
|
||||||
|
: const HeaderWidget(),
|
||||||
footer: const SizedBox(
|
footer: const SizedBox(
|
||||||
height: 160,
|
height: 160,
|
||||||
),
|
),
|
||||||
selectedFiles: _selectedFiles,
|
selectedFiles: _selectedFiles,
|
||||||
),
|
),
|
||||||
_userCollectionsTab,
|
if (!isOfflineMode) _userCollectionsTab,
|
||||||
_sharedCollectionTab,
|
if (isOfflineMode) _sharedCollectionTab,
|
||||||
_searchTab,
|
if (!isOfflineMode) _searchTab,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -745,10 +751,11 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
HomeBottomNavigationBar(
|
if (!isOfflineMode)
|
||||||
_selectedFiles,
|
HomeBottomNavigationBar(
|
||||||
selectedTabIndex: _selectedTabIndex,
|
_selectedFiles,
|
||||||
),
|
selectedTabIndex: _selectedTabIndex,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import "dart:math";
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
import "package:photos/core/configuration.dart";
|
||||||
import 'package:photos/core/event_bus.dart';
|
import 'package:photos/core/event_bus.dart';
|
||||||
import 'package:photos/events/collection_updated_event.dart';
|
import 'package:photos/events/collection_updated_event.dart';
|
||||||
import 'package:photos/events/local_photos_updated_event.dart';
|
import 'package:photos/events/local_photos_updated_event.dart';
|
||||||
@@ -71,6 +72,11 @@ class _SharedCollectionsTabState extends State<SharedCollectionsTab>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (Configuration.instance.getUserID() == null) {
|
||||||
|
return const Center(
|
||||||
|
child: Text("Please login to view shared collections"),
|
||||||
|
);
|
||||||
|
}
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return FutureBuilder<SharedCollections>(
|
return FutureBuilder<SharedCollections>(
|
||||||
future: Future.value(CollectionsService.instance.getSharedCollections()),
|
future: Future.value(CollectionsService.instance.getSharedCollections()),
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
debugPrint('file_details_sheet initState');
|
debugPrint('file_details_sheet initState');
|
||||||
_currentUserID = Configuration.instance.getUserID()!;
|
_currentUserID = Configuration.instance.getUserID() ?? 0;
|
||||||
hasLocationData.value = widget.file.hasLocation;
|
hasLocationData.value = widget.file.hasLocation;
|
||||||
_isImage = widget.file.fileType == FileType.image ||
|
_isImage = widget.file.fileType == FileType.image ||
|
||||||
widget.file.fileType == FileType.livePhoto;
|
widget.file.fileType == FileType.livePhoto;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import "dart:async";
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:photos/core/cache/thumbnail_in_memory_cache.dart';
|
import 'package:photos/core/cache/thumbnail_in_memory_cache.dart';
|
||||||
|
import "package:photos/core/configuration.dart";
|
||||||
import 'package:photos/core/constants.dart';
|
import 'package:photos/core/constants.dart';
|
||||||
import 'package:photos/core/errors.dart';
|
import 'package:photos/core/errors.dart';
|
||||||
import 'package:photos/core/event_bus.dart';
|
import 'package:photos/core/event_bus.dart';
|
||||||
@@ -119,6 +120,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
int? user = Configuration.instance.getUserID();
|
||||||
if (widget.file.isRemoteFile) {
|
if (widget.file.isRemoteFile) {
|
||||||
_loadNetworkImage();
|
_loadNetworkImage();
|
||||||
} else {
|
} else {
|
||||||
@@ -193,7 +195,9 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
|
|||||||
const ThumbnailPlaceHolder(),
|
const ThumbnailPlaceHolder(),
|
||||||
content ?? const SizedBox(),
|
content ?? const SizedBox(),
|
||||||
];
|
];
|
||||||
if (widget.shouldShowSyncStatus && !widget.file.isUploaded) {
|
if (widget.shouldShowSyncStatus &&
|
||||||
|
!widget.file.isUploaded &&
|
||||||
|
user != null) {
|
||||||
viewChildren.add(const UnSyncedIcon());
|
viewChildren.add(const UnSyncedIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import "package:flutter/foundation.dart";
|
|||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_animate/flutter_animate.dart";
|
import "package:flutter_animate/flutter_animate.dart";
|
||||||
import "package:logging/logging.dart";
|
import "package:logging/logging.dart";
|
||||||
|
import "package:photos/core/configuration.dart";
|
||||||
import "package:photos/generated/l10n.dart";
|
import "package:photos/generated/l10n.dart";
|
||||||
import "package:photos/models/search/album_search_result.dart";
|
import "package:photos/models/search/album_search_result.dart";
|
||||||
import "package:photos/models/search/generic_search_result.dart";
|
import "package:photos/models/search/generic_search_result.dart";
|
||||||
@@ -57,6 +58,10 @@ class _SearchTabState extends State<SearchTab> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (Configuration.instance.getUserID() == null) {
|
||||||
|
return const Text("Not logged in");
|
||||||
|
}
|
||||||
|
|
||||||
return AllSectionsExamplesProvider(
|
return AllSectionsExamplesProvider(
|
||||||
child: FadeIndexedStack(
|
child: FadeIndexedStack(
|
||||||
lazy: false,
|
lazy: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user