This commit is contained in:
2025-05-30 11:47:38 +08:00
parent fd6fa65e2b
commit 195598f398
3 changed files with 26 additions and 18 deletions

View File

@@ -365,5 +365,6 @@
"message": "Message",
"type": "Type",
"level": "Level",
"galleryListDisplayMode": "Display mode for gallery list"
"galleryListDisplayMode": "Display mode for gallery list",
"noGalleriesFound": "No galleries found."
}

View File

@@ -365,5 +365,6 @@
"message": "消息",
"type": "类型",
"level": "级别",
"galleryListDisplayMode": "画廊列表的显示模式"
"galleryListDisplayMode": "画廊列表的显示模式",
"noGalleriesFound": "找不到画廊"
}

View File

@@ -72,22 +72,24 @@ class _GalleriesPage extends State<GalleriesPage>
category: widget.category,
tag: widget.tag))
.unwrap();
final thumbnails =
(await api.getGalleriesThumbnail(list.map((e) => e.gid).toList()))
.unwrap();
_thumbnails.merge(thumbnails);
final files = (await api.getFiles(list
.map((e) {
var thumbnail = _thumbnails.thumbnails[e.gid];
if (thumbnail != null && thumbnail.ok) {
return thumbnail.unwrap().token;
}
})
.where((t) => t != null)
.cast<String>()
.toList()))
.unwrap();
_files.merge(files);
if (list.isNotEmpty) {
final thumbnails =
(await api.getGalleriesThumbnail(list.map((e) => e.gid).toList()))
.unwrap();
_thumbnails.merge(thumbnails);
final files = (await api.getFiles(list
.map((e) {
var thumbnail = _thumbnails.thumbnails[e.gid];
if (thumbnail != null && thumbnail.ok) {
return thumbnail.unwrap().token;
}
})
.where((t) => t != null)
.cast<String>()
.toList()))
.unwrap();
_files.merge(files);
}
final isLastPage = list.length < _pageSize;
if (isLastPage) {
_pagingController.appendLastPage(list);
@@ -268,6 +270,10 @@ class _GalleriesPage extends State<GalleriesPage>
extra: GalleryPageExtra(title: item.preferredTitle));
},
);
}, noItemsFoundIndicatorBuilder: (context) {
return Center(
child: Text(i18n.noGalleriesFound,
style: Theme.of(context).textTheme.titleLarge));
}),
)));
}