mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 16:04:43 +01:00
Fix new provider being created instead of modified
This commit is contained in:
parent
99b3e9f7fa
commit
a15f7a0db6
5 changed files with 12 additions and 10 deletions
|
@ -297,7 +297,7 @@ class AlbumAppDbDataSource implements AlbumDataSource {
|
||||||
}).reduce((value, element) => value + element);
|
}).reduce((value, element) => value + element);
|
||||||
return entries.first.album.copyWith(
|
return entries.first.album.copyWith(
|
||||||
lastUpdated: OrNull(null),
|
lastUpdated: OrNull(null),
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(entries.first.album).copyWith(
|
||||||
items: items,
|
items: items,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -433,7 +433,9 @@ Future<void> _cacheAlbum(
|
||||||
pair.item1,
|
pair.item1,
|
||||||
album.copyWith(
|
album.copyWith(
|
||||||
lastUpdated: OrNull(null),
|
lastUpdated: OrNull(null),
|
||||||
provider: AlbumStaticProvider(items: pair.item2),
|
provider: AlbumStaticProvider.of(album).copyWith(
|
||||||
|
items: pair.item2,
|
||||||
|
),
|
||||||
))));
|
))));
|
||||||
} else {
|
} else {
|
||||||
entries.add(AppDbAlbumEntry(path, 0, album));
|
entries.add(AppDbAlbumEntry(path, 0, album));
|
||||||
|
|
|
@ -12,7 +12,7 @@ class AddToAlbum {
|
||||||
UpdateAlbum(albumRepo)(
|
UpdateAlbum(albumRepo)(
|
||||||
account,
|
account,
|
||||||
album.copyWith(
|
album.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(album).copyWith(
|
||||||
items: makeDistinctAlbumItems([
|
items: makeDistinctAlbumItems([
|
||||||
...items,
|
...items,
|
||||||
...AlbumStaticProvider.of(album).items,
|
...AlbumStaticProvider.of(album).items,
|
||||||
|
|
|
@ -96,7 +96,7 @@ class _CleanUpAlbums {
|
||||||
await UpdateAlbum(albumRepo)(
|
await UpdateAlbum(albumRepo)(
|
||||||
account,
|
account,
|
||||||
a.copyWith(
|
a.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(a).copyWith(
|
||||||
items: newItems,
|
items: newItems,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -325,7 +325,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
|
|
||||||
final albumRepo = AlbumRepo(AlbumCachedDataSource());
|
final albumRepo = AlbumRepo(AlbumCachedDataSource());
|
||||||
final newAlbum = _album!.copyWith(
|
final newAlbum = _album!.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(_album!).copyWith(
|
||||||
items: newItems,
|
items: newItems,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -449,7 +449,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
sortProvider: const AlbumNullSortProvider(),
|
sortProvider: const AlbumNullSortProvider(),
|
||||||
// save the current order
|
// save the current order
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(_editAlbum!).copyWith(
|
||||||
items: _sortedItems,
|
items: _sortedItems,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -467,7 +467,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(_editAlbum!).copyWith(
|
||||||
items: [
|
items: [
|
||||||
AlbumLabelItem(text: value),
|
AlbumLabelItem(text: value),
|
||||||
..._sortedItems,
|
..._sortedItems,
|
||||||
|
@ -492,7 +492,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
}
|
}
|
||||||
_sortedItems[index] = AlbumLabelItem(text: value);
|
_sortedItems[index] = AlbumLabelItem(text: value);
|
||||||
_editAlbum = _editAlbum!.copyWith(
|
_editAlbum = _editAlbum!.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(_editAlbum!).copyWith(
|
||||||
items: _sortedItems,
|
items: _sortedItems,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -624,7 +624,7 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
||||||
return e[0];
|
return e[0];
|
||||||
}).toList();
|
}).toList();
|
||||||
final propagateAlbum = album.copyWith(
|
final propagateAlbum = album.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(album).copyWith(
|
||||||
items: propagateItems,
|
items: propagateItems,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -308,7 +308,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
||||||
await UpdateAlbum(albumRepo)(
|
await UpdateAlbum(albumRepo)(
|
||||||
widget.account,
|
widget.account,
|
||||||
widget.album!.copyWith(
|
widget.album!.copyWith(
|
||||||
provider: AlbumStaticProvider(
|
provider: AlbumStaticProvider.of(widget.album!).copyWith(
|
||||||
items: newItems,
|
items: newItems,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Reference in a new issue