v1.1.11+41
All checks were successful
Flutter Schmutter / build (push) Successful in 3m57s

- fixed: duplicates on the frontpage
- new: search by tag
This commit is contained in:
2025-06-10 08:39:55 +02:00
parent e945844151
commit c35308fbc1
11 changed files with 187 additions and 35 deletions

View File

@ -102,8 +102,17 @@ class MediaNotifier extends StateNotifier<MediaState> {
}
void addMediaItems(List<MediaItem> newItems) {
final updated = List<MediaItem>.from(state.mediaItems)..addAll(newItems);
state = state.replace(mediaItems: updated);
final Set<int> existingIds = state.mediaItems
.map((item) => item.id)
.toSet();
final List<MediaItem> filteredItems = newItems
.where((item) => !existingIds.contains(item.id))
.toList();
if (filteredItems.isNotEmpty) {
final List<MediaItem> updated = List<MediaItem>.from(state.mediaItems)
..addAll(filteredItems);
state = state.replace(mediaItems: updated);
}
}
Future<void> loadMedia({int? id}) async {