mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: block settings import #7
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -399,6 +399,7 @@ class _BangumiInfoState extends State<BangumiInfo>
|
|||||||
: widget.bangumiDetail!.episodes!.first.cid),
|
: widget.bangumiDetail!.episodes!.first.cid),
|
||||||
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
||||||
showEpisodes: widget.showEpisodes,
|
showEpisodes: widget.showEpisodes,
|
||||||
|
newEp: bangumiItem?.newEp,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class BangumiPanel extends StatefulWidget {
|
|||||||
required this.changeFuc,
|
required this.changeFuc,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
|
this.newEp,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<EpisodeItem> pages;
|
final List<EpisodeItem> pages;
|
||||||
@@ -22,6 +23,7 @@ class BangumiPanel extends StatefulWidget {
|
|||||||
final Function changeFuc;
|
final Function changeFuc;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
final dynamic newEp;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||||
@@ -126,7 +128,9 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
cid,
|
cid,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'全${widget.pages.length}话',
|
widget.newEp?['desc']?.contains('连载') == true
|
||||||
|
? '连载中,更新至第${widget.newEp?['title']}话'
|
||||||
|
: '全${widget.newEp?['title']}话',
|
||||||
style: const TextStyle(fontSize: 13),
|
style: const TextStyle(fontSize: 13),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class HistoryController extends GetxController {
|
|||||||
Future queryHistoryList({type = 'init'}) async {
|
Future queryHistoryList({type = 'init'}) async {
|
||||||
int max = 0;
|
int max = 0;
|
||||||
int viewAt = 0;
|
int viewAt = 0;
|
||||||
if (type == 'onload') {
|
if (type == 'onload' && historyList.isNotEmpty) {
|
||||||
max = historyList.last.history!.oid!;
|
max = historyList.last.history!.oid!;
|
||||||
viewAt = historyList.last.viewAt!;
|
viewAt = historyList.last.viewAt!;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,19 +32,13 @@ Widget searchBangumiPanel(BuildContext context, ctr, loadingState) {
|
|||||||
var i = loadingState.response[index];
|
var i = loadingState.response[index];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
/// TODO 番剧详情页面
|
Utils.viewBangumi(seasonId: i.seasonId);
|
||||||
// Get.toNamed('/video?bvid=${i.bvid}&cid=${i.cid}', arguments: {
|
|
||||||
// 'videoItem': i,
|
|
||||||
// 'heroTag': Utils.makeHeroTag(i.id),
|
|
||||||
// 'videoType': SearchType.media_bangumi
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.symmetric(
|
||||||
StyleString.safeSpace,
|
horizontal: StyleString.safeSpace,
|
||||||
StyleString.safeSpace,
|
vertical: StyleString.cardSpace,
|
||||||
StyleString.safeSpace,
|
),
|
||||||
2),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -127,57 +121,6 @@ Widget searchBangumiPanel(BuildContext context, ctr, loadingState) {
|
|||||||
Text(i.indexShow, style: style),
|
Text(i.indexShow, style: style),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 18),
|
|
||||||
SizedBox(
|
|
||||||
height: 32,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
Utils.viewBangumi(seasonId: i.seasonId);
|
|
||||||
// SmartDialog.showLoading(msg: '获取中...');
|
|
||||||
// var res = await SearchHttp.bangumiInfo(
|
|
||||||
// seasonId: i.seasonId);
|
|
||||||
// SmartDialog.dismiss().then((value) {
|
|
||||||
// if (res['status']) {
|
|
||||||
// EpisodeItem episode =
|
|
||||||
// res['data'].episodes.first;
|
|
||||||
// int? epId = res['data']
|
|
||||||
// .userStatus
|
|
||||||
// ?.progress
|
|
||||||
// ?.lastEpId;
|
|
||||||
// if (epId == null) {
|
|
||||||
// epId = episode.epId;
|
|
||||||
// } else {
|
|
||||||
// for (var item
|
|
||||||
// in res['data'].episodes) {
|
|
||||||
// if (item.epId == epId) {
|
|
||||||
// episode = item;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// String bvid = episode.bvid!;
|
|
||||||
// int cid = episode.cid!;
|
|
||||||
// String pic = episode.cover!;
|
|
||||||
// String heroTag =
|
|
||||||
// Utils.makeHeroTag(cid);
|
|
||||||
// Get.toNamed(
|
|
||||||
// '/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}&epId=$epId',
|
|
||||||
// arguments: {
|
|
||||||
// 'pic': pic,
|
|
||||||
// 'heroTag': heroTag,
|
|
||||||
// 'videoType':
|
|
||||||
// SearchType.media_bangumi,
|
|
||||||
// 'bangumiItem': res['data'],
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// SmartDialog.showToast(res['msg']);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
child: const Text('观看'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class GStorage {
|
|||||||
static late final Box<dynamic> video;
|
static late final Box<dynamic> video;
|
||||||
|
|
||||||
static List<Pair<SegmentType, SkipType>> get blockSettings {
|
static List<Pair<SegmentType, SkipType>> get blockSettings {
|
||||||
List<int> list = setting.get(
|
List list = setting.get(
|
||||||
SettingBoxKey.blockSettings,
|
SettingBoxKey.blockSettings,
|
||||||
defaultValue: List.generate(SegmentType.values.length, (_) => 1),
|
defaultValue: List.generate(SegmentType.values.length, (_) => 1),
|
||||||
);
|
);
|
||||||
@@ -37,7 +37,7 @@ class GStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static List<Color> get blockColor {
|
static List<Color> get blockColor {
|
||||||
List<String> list = setting.get(
|
List list = setting.get(
|
||||||
SettingBoxKey.blockColor,
|
SettingBoxKey.blockColor,
|
||||||
defaultValue: List.generate(SegmentType.values.length, (_) => ''),
|
defaultValue: List.generate(SegmentType.values.length, (_) => ''),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user