mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(mobile): hash assets in isolate (#18924)
This commit is contained in:
parent
b46e066cc2
commit
ce6631f7e0
34 changed files with 1254 additions and 428 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:immich_mobile/domain/models/log.model.dart';
|
||||
|
|
@ -15,7 +16,6 @@ abstract final class DLog {
|
|||
static Stream<List<LogMessage>> watchLog() {
|
||||
final db = Isar.getInstance();
|
||||
if (db == null) {
|
||||
debugPrint('Isar is not initialized');
|
||||
return const Stream.empty();
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,6 @@ abstract final class DLog {
|
|||
static void clearLog() {
|
||||
final db = Isar.getInstance();
|
||||
if (db == null) {
|
||||
debugPrint('Isar is not initialized');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +39,9 @@ abstract final class DLog {
|
|||
}
|
||||
|
||||
static void log(String message, [Object? error, StackTrace? stackTrace]) {
|
||||
debugPrint('[$kDevLoggerTag] [${DateTime.now()}] $message');
|
||||
if (!Platform.environment.containsKey('FLUTTER_TEST')) {
|
||||
debugPrint('[$kDevLoggerTag] [${DateTime.now()}] $message');
|
||||
}
|
||||
if (error != null) {
|
||||
debugPrint('Error: $error');
|
||||
}
|
||||
|
|
@ -50,7 +51,6 @@ abstract final class DLog {
|
|||
|
||||
final isar = Isar.getInstance();
|
||||
if (isar == null) {
|
||||
debugPrint('Isar is not initialized');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ final _features = [
|
|||
icon: Icons.photo_library_rounded,
|
||||
onTap: (_, ref) => ref.read(backgroundSyncProvider).syncLocal(full: true),
|
||||
),
|
||||
_Feature(
|
||||
name: 'Hash Local Assets',
|
||||
icon: Icons.numbers_outlined,
|
||||
onTap: (_, ref) => ref.read(backgroundSyncProvider).hashAssets(),
|
||||
),
|
||||
_Feature(
|
||||
name: 'Sync Remote',
|
||||
icon: Icons.refresh_rounded,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/domain/models/local_album.model.dart';
|
||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
||||
|
|
@ -94,9 +93,8 @@ class LocalMediaSummaryPage extends StatelessWidget {
|
|||
),
|
||||
FutureBuilder(
|
||||
future: albumsFuture,
|
||||
initialData: <LocalAlbum>[],
|
||||
builder: (_, snap) {
|
||||
final albums = snap.data!;
|
||||
final albums = snap.data ?? [];
|
||||
if (albums.isEmpty) {
|
||||
return const SliverToBoxAdapter(child: SizedBox.shrink());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue