Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

better popular page

Predidit448b222d5a9b
diff --git a/lib/pages/popular/popular_page.dart b/lib/pages/popular/popular_page.dart
index 44351e28..afe82ae6 100644
--- a/lib/pages/popular/popular_page.dart
+++ b/lib/pages/popular/popular_page.dart
@@ -41,7 +41,7 @@ class _PopularPageState extends State<PopularPage>
timeout = false;
navigationBarState =
Provider.of<NavigationBarState>(context, listen: false);
- if (popularController.bangumiList.length < 5) {
+ if (popularController.bangumiList.isEmpty) {
debugPrint('Popular缓存列表为空, 尝试重加载');
Timer(const Duration(seconds: 3), () {
timeout = true;
@@ -95,10 +95,8 @@ class _PopularPageState extends State<PopularPage>
},
child: Scaffold(
appBar: SysAppBar(
- backgroundColor: Theme.of(context)
- .colorScheme
- .primary
- .withOpacity(0.5),
+ backgroundColor:
+ Theme.of(context).colorScheme.primary.withOpacity(0.5),
title: TextField(
focusNode: _focusNode,
controller: _controller,
@@ -121,8 +119,13 @@ class _PopularPageState extends State<PopularPage>
scrollController.jumpTo(0.0);
},
onSubmitted: (t) {
- popularController.searchKeyword = t;
- popularController.queryBangumi(popularController.searchKeyword);
+ if (t != '') {
+ popularController.searchKeyword = t;
+ popularController
+ .queryBangumi(popularController.searchKeyword);
+ } else {
+ popularController.queryBangumiListFeed();
+ }
},
),
// actions: [IconButton(onPressed: () {
@@ -151,16 +154,16 @@ class _PopularPageState extends State<PopularPage>
padding: const EdgeInsets.fromLTRB(
StyleString.safeSpace, 0, StyleString.safeSpace, 0),
sliver: Observer(builder: (context) {
- if (popularController.bangumiList.length <= 1 &&
+ if (popularController.bangumiList.isEmpty &&
timeout == true) {
return HttpError(
- errMsg: '加载推荐流错误',
+ errMsg: '什么都没有找到 (´;ω;`)',
fn: () {
popularController.queryBangumiListFeed();
},
);
}
- if (popularController.bangumiList.length <= 1 &&
+ if (popularController.bangumiList.isEmpty &&
timeout == false) {
return const SliverToBoxAdapter(
child: SizedBox(
diff --git a/lib/request/bangumi.dart b/lib/request/bangumi.dart
index 42fba036..0ad23fac 100644
--- a/lib/request/bangumi.dart
+++ b/lib/request/bangumi.dart
@@ -72,7 +72,7 @@ class BangumiHTTP {
'Predidit/Kazumi/0.0.1 (Android) (https://github.com/Predidit/Kazumi)',
'referer': '',
};
- Map<String, String> keywordMap = {'type': '2', 'responseGroup': 'large'};
+ Map<String, String> keywordMap = {'type': '2', 'responseGroup': 'large', 'max_results': '25'};
try {
final res = await Request().get(