mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
parent
0cb3dc6211
commit
c8eef5ad4d
@ -160,7 +160,7 @@ class BackgroundServicePlugin: NSObject, FlutterPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by the flutter code when enabled so that we can turn on the backround services
|
// Called by the flutter code when enabled so that we can turn on the background services
|
||||||
// and save the callback information to communicate on this method channel
|
// and save the callback information to communicate on this method channel
|
||||||
public func handleBackgroundEnable(call: FlutterMethodCall, result: FlutterResult) {
|
public func handleBackgroundEnable(call: FlutterMethodCall, result: FlutterResult) {
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class BackgroundServicePlugin: NSObject, FlutterPlugin {
|
|||||||
result(true)
|
result(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the number of currently scheduled background processes to Flutter, striclty
|
// Returns the number of currently scheduled background processes to Flutter, strictly
|
||||||
// for debugging
|
// for debugging
|
||||||
func handleNumberOfProcesses(call: FlutterMethodCall, result: @escaping FlutterResult) {
|
func handleNumberOfProcesses(call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
BGTaskScheduler.shared.getPendingTaskRequests { requests in
|
BGTaskScheduler.shared.getPendingTaskRequests { requests in
|
||||||
@ -355,7 +355,7 @@ class BackgroundServicePlugin: NSObject, FlutterPlugin {
|
|||||||
let isExpensive = wifiMonitor.currentPath.isExpensive
|
let isExpensive = wifiMonitor.currentPath.isExpensive
|
||||||
if (isExpensive) {
|
if (isExpensive) {
|
||||||
// The network is expensive and we have required Wi-Fi
|
// The network is expensive and we have required Wi-Fi
|
||||||
// Therfore, we will simply complete the task without
|
// Therefore, we will simply complete the task without
|
||||||
// running it
|
// running it
|
||||||
task.setTaskCompleted(success: true)
|
task.setTaskCompleted(success: true)
|
||||||
return
|
return
|
||||||
|
@ -7,7 +7,7 @@ mixin ErrorLoggerMixin {
|
|||||||
abstract final Logger logger;
|
abstract final Logger logger;
|
||||||
|
|
||||||
/// Returns an AsyncValue<T> if the future is successfully executed
|
/// Returns an AsyncValue<T> if the future is successfully executed
|
||||||
/// Else, logs the error to the overrided logger and returns an AsyncError<>
|
/// Else, logs the error to the overridden logger and returns an AsyncError<>
|
||||||
AsyncFuture<T> guardError<T>(
|
AsyncFuture<T> guardError<T>(
|
||||||
Future<T> Function() fn, {
|
Future<T> Function() fn, {
|
||||||
required String errorMessage,
|
required String errorMessage,
|
||||||
|
@ -104,7 +104,7 @@ class DownloadStateNotifier extends StateNotifier<DownloadState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _taskProgressCallback(TaskProgressUpdate update) {
|
void _taskProgressCallback(TaskProgressUpdate update) {
|
||||||
// Ignore if the task is cancled or completed
|
// Ignore if the task is canceled or completed
|
||||||
if (update.progress == -2 || update.progress == -1) {
|
if (update.progress == -2 || update.progress == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class ShareIntentUploadStateNotifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _taskProgressCallback(TaskProgressUpdate update) {
|
void _taskProgressCallback(TaskProgressUpdate update) {
|
||||||
// Ignore if the task is cancled or completed
|
// Ignore if the task is canceled or completed
|
||||||
if (update.progress == downloadFailed ||
|
if (update.progress == downloadFailed ||
|
||||||
update.progress == downloadCompleted) {
|
update.progress == downloadCompleted) {
|
||||||
return;
|
return;
|
||||||
|
@ -47,7 +47,7 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Validating the url is the alternative connecting server url without
|
/// Validating the url is the alternative connecting server url without
|
||||||
/// saving the infomation to the local database
|
/// saving the information to the local database
|
||||||
Future<bool> validateAuxilaryServerUrl(String url) async {
|
Future<bool> validateAuxilaryServerUrl(String url) async {
|
||||||
try {
|
try {
|
||||||
final validEndpoint = await _apiService.resolveEndpoint(url);
|
final validEndpoint = await _apiService.resolveEndpoint(url);
|
||||||
|
@ -6,7 +6,7 @@ import 'package:permission_handler/permission_handler.dart';
|
|||||||
|
|
||||||
class GalleryPermissionNotifier extends StateNotifier<PermissionStatus> {
|
class GalleryPermissionNotifier extends StateNotifier<PermissionStatus> {
|
||||||
GalleryPermissionNotifier()
|
GalleryPermissionNotifier()
|
||||||
: super(PermissionStatus.denied) // Denied is the intitial state
|
: super(PermissionStatus.denied) // Denied is the initial state
|
||||||
{
|
{
|
||||||
// Sets the initial state
|
// Sets the initial state
|
||||||
getGalleryPermissionStatus();
|
getGalleryPermissionStatus();
|
||||||
|
@ -75,7 +75,7 @@ class AuthService {
|
|||||||
isValid = true;
|
isValid = true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
_log.severe("Error validating auxilary endpoint", error);
|
_log.severe("Error validating auxiliary endpoint", error);
|
||||||
} finally {
|
} finally {
|
||||||
httpclient.close();
|
httpclient.close();
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ class AuthService {
|
|||||||
_log.severe("Cannot resolve endpoint", error);
|
_log.severe("Cannot resolve endpoint", error);
|
||||||
continue;
|
continue;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
_log.severe("Auxilary server is not valid");
|
_log.severe("Auxiliary server is not valid");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ class BackgroundService {
|
|||||||
try {
|
try {
|
||||||
_clearErrorNotifications();
|
_clearErrorNotifications();
|
||||||
|
|
||||||
// iOS should time out after some threshhold so it doesn't wait
|
// iOS should time out after some threshold so it doesn't wait
|
||||||
// indefinitely and can run later
|
// indefinitely and can run later
|
||||||
// Android is fine to wait here until the lock releases
|
// Android is fine to wait here until the lock releases
|
||||||
final waitForLock = Platform.isIOS
|
final waitForLock = Platform.isIOS
|
||||||
|
@ -639,7 +639,7 @@ class SyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// fast path for common case: only new assets were added to device album
|
/// fast path for common case: only new assets were added to device album
|
||||||
/// returns `true` if successfull, else `false`
|
/// returns `true` if successful, else `false`
|
||||||
Future<bool> _syncDeviceAlbumFast(Album deviceAlbum, Album dbAlbum) async {
|
Future<bool> _syncDeviceAlbumFast(Album deviceAlbum, Album dbAlbum) async {
|
||||||
if (!deviceAlbum.modifiedAt.isAfter(dbAlbum.modifiedAt)) {
|
if (!deviceAlbum.modifiedAt.isAfter(dbAlbum.modifiedAt)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5,7 +5,7 @@ import 'package:immich_mobile/providers/image/immich_remote_image_provider.dart'
|
|||||||
import 'package:immich_mobile/providers/image/immich_remote_thumbnail_provider.dart';
|
import 'package:immich_mobile/providers/image/immich_remote_thumbnail_provider.dart';
|
||||||
|
|
||||||
/// [ImageCache] that uses two caches for small and large images
|
/// [ImageCache] that uses two caches for small and large images
|
||||||
/// so that a single large image does not evict all small iamges
|
/// so that a single large image does not evict all small images
|
||||||
final class CustomImageCache implements ImageCache {
|
final class CustomImageCache implements ImageCache {
|
||||||
final _small = ImageCache();
|
final _small = ImageCache();
|
||||||
final _large = ImageCache()..maximumSize = 5; // Maximum 5 images
|
final _large = ImageCache()..maximumSize = 5; // Maximum 5 images
|
||||||
|
@ -26,7 +26,7 @@ double getScaleForScaleState(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Internal class to wraps custom scale boundaries (min, max and initial)
|
/// Internal class to wraps custom scale boundaries (min, max and initial)
|
||||||
/// Also, stores values regarding the two sizes: the container and teh child.
|
/// Also, stores values regarding the two sizes: the container and the child.
|
||||||
class ScaleBoundaries {
|
class ScaleBoundaries {
|
||||||
const ScaleBoundaries(
|
const ScaleBoundaries(
|
||||||
this._minScale,
|
this._minScale,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user