mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Fix empty albums are not cached
This commit is contained in:
parent
b47cb5c63c
commit
20a69b5620
1 changed files with 8 additions and 2 deletions
|
@ -474,8 +474,14 @@ Future<void> _cacheAlbum(
|
|||
// count number of entries for this album
|
||||
final count = await index.count(range);
|
||||
int newCount = 0;
|
||||
for (final pair
|
||||
in partition(album.items, AppDbAlbumEntry.maxDataSize).withIndex()) {
|
||||
|
||||
var albumItemLists =
|
||||
partition(album.items, AppDbAlbumEntry.maxDataSize).toList();
|
||||
if (albumItemLists.isEmpty) {
|
||||
albumItemLists = [<AlbumItem>[]];
|
||||
}
|
||||
|
||||
for (final pair in albumItemLists.withIndex()) {
|
||||
_log.info(
|
||||
"[_cacheAlbum] Caching $path[${pair.item1}], length: ${pair.item2.length}");
|
||||
await store.put(
|
||||
|
|
Loading…
Reference in a new issue