intermediate

This commit is contained in:
Fabian Freund
2025-01-07 00:06:31 +01:00
parent ea0880b97a
commit 4a2191b01d
84 changed files with 2655 additions and 1383 deletions
@@ -1,5 +1,6 @@
import 'package:lensai/features/bangs/data/models/bang.dart';
import 'package:lensai/features/bangs/data/models/bang_data.dart';
import 'package:lensai/features/bangs/data/models/search_history_entry.dart';
import 'package:lensai/features/bangs/domain/repositories/data.dart';
import 'package:lensai/features/bangs/domain/repositories/sync.dart';
import 'package:riverpod/riverpod.dart';
@@ -50,6 +51,12 @@ Stream<List<BangData>> frequentBangDataList(Ref ref) {
return repository.watchFrequentBangs();
}
@Riverpod()
Stream<List<SearchHistoryEntry>> searchHistory(Ref ref) {
final repository = ref.watch(bangDataRepositoryProvider.notifier);
return repository.watchSearchHistory(limit: 3); //TODO: make count dynamic
}
@Riverpod()
Future<BangData> bangDataEnsureIcon(
Ref ref,
@@ -78,9 +85,3 @@ Stream<int> bangCountOfGroup(
final repository = ref.watch(bangDataRepositoryProvider.notifier);
return repository.watchBangCount(group);
}
@Riverpod()
Stream<double> bangIconCacheSizeMegabytes(Ref ref) {
final repository = ref.watch(bangDataRepositoryProvider.notifier);
return repository.watchIconCacheSize();
}