mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 22:06:38 +08:00
fix legacy library scan and empty pages
This commit is contained in:
@@ -92,8 +92,13 @@ func listLibrarySeriesHandler(svc *service.Container) gin.HandlerFunc {
|
||||
if end > len(items) {
|
||||
end = len(items)
|
||||
}
|
||||
pageItems := items[start:end]
|
||||
if pageItems == nil {
|
||||
// 非 nil 空切片,避免空库返回 "items": null 触发前端崩溃。
|
||||
pageItems = []service.SeriesCard{}
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"items": items[start:end],
|
||||
"items": pageItems,
|
||||
"total": total,
|
||||
"page": page,
|
||||
"page_size": size,
|
||||
|
||||
Reference in New Issue
Block a user