mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: bangumi
This commit is contained in:
@@ -457,10 +457,10 @@ class BangumiIntroController extends CommonController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int epid = episodes[prevIndex].epid!;
|
int epid = episodes[prevIndex].epId;
|
||||||
int cid = episodes[prevIndex].cid!;
|
int cid = episodes[prevIndex].cid;
|
||||||
String bvid = episodes[prevIndex].bvid!;
|
String bvid = episodes[prevIndex].bvid;
|
||||||
int aid = episodes[prevIndex].aid!;
|
int aid = episodes[prevIndex].aid;
|
||||||
dynamic cover = episodes[prevIndex].cover;
|
dynamic cover = episodes[prevIndex].cover;
|
||||||
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
||||||
return true;
|
return true;
|
||||||
@@ -493,10 +493,10 @@ class BangumiIntroController extends CommonController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int epid = episodes[nextIndex].epid!;
|
int epid = episodes[nextIndex].epId;
|
||||||
int cid = episodes[nextIndex].cid!;
|
int cid = episodes[nextIndex].cid;
|
||||||
String bvid = episodes[nextIndex].bvid!;
|
String bvid = episodes[nextIndex].bvid;
|
||||||
int aid = episodes[nextIndex].aid!;
|
int aid = episodes[nextIndex].aid;
|
||||||
dynamic cover = episodes[nextIndex].cover;
|
dynamic cover = episodes[nextIndex].cover;
|
||||||
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPalaX/common/widgets/pair.dart';
|
|||||||
import 'package:PiliPalaX/pages/video/detail/controller.dart'
|
import 'package:PiliPalaX/pages/video/detail/controller.dart'
|
||||||
show SegmentType, SegmentTypeExt, SkipType, SkipTypeExt;
|
show SegmentType, SegmentTypeExt, SkipType, SkipTypeExt;
|
||||||
import 'package:PiliPalaX/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ class SponsorBlockPage extends StatefulWidget {
|
|||||||
class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||||
late double _blockLimit;
|
late double _blockLimit;
|
||||||
late List<Pair<SegmentType, SkipType>> _blockSettings;
|
late List<Pair<SegmentType, SkipType>> _blockSettings;
|
||||||
|
final _url = 'https://github.com/hanydd/BilibiliSponsorBlock';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -37,8 +39,15 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: ListView.separated(
|
body: ListView.separated(
|
||||||
itemCount: _blockSettings.length + 1,
|
itemCount: _blockSettings.length + 2,
|
||||||
itemBuilder: (_, index) => index == 0
|
itemBuilder: (_, index) => index == _blockSettings.length + 1
|
||||||
|
? ListTile(
|
||||||
|
leading: Icon(Icons.code),
|
||||||
|
title: const Text('About'),
|
||||||
|
subtitle: Text(_url),
|
||||||
|
onTap: () => Utils.launchURL(_url),
|
||||||
|
)
|
||||||
|
: index == 0
|
||||||
? ListTile(
|
? ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final textController =
|
final textController =
|
||||||
@@ -49,8 +58,8 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Block Limit'),
|
title: const Text('Block Limit'),
|
||||||
content: TextFormField(
|
content: TextFormField(
|
||||||
keyboardType:
|
keyboardType: TextInputType.numberWithOptions(
|
||||||
TextInputType.numberWithOptions(decimal: true),
|
decimal: true),
|
||||||
controller: textController,
|
controller: textController,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
decoration: InputDecoration(suffixText: 's'),
|
decoration: InputDecoration(suffixText: 's'),
|
||||||
@@ -61,17 +70,20 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'取消',
|
'取消',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color:
|
||||||
|
Theme.of(context).colorScheme.outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
_blockLimit = max(0.0,
|
_blockLimit = max(
|
||||||
double.tryParse(textController.text) ?? 0.0);
|
0.0,
|
||||||
await GStorage.setting
|
double.tryParse(textController.text) ??
|
||||||
.put(SettingBoxKey.blockLimit, _blockLimit);
|
0.0);
|
||||||
|
await GStorage.setting.put(
|
||||||
|
SettingBoxKey.blockLimit, _blockLimit);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Text('确定'),
|
child: Text('确定'),
|
||||||
@@ -104,7 +116,8 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
_blockSettings[index - 1].first.name,
|
_blockSettings[index - 1].first.name,
|
||||||
style: _blockSettings[index - 1].second == SkipType.disable
|
style:
|
||||||
|
_blockSettings[index - 1].second == SkipType.disable
|
||||||
? TextStyle(
|
? TextStyle(
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: Theme.of(context).colorScheme.outline,
|
||||||
)
|
)
|
||||||
@@ -144,8 +157,8 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
Icon(
|
Icon(
|
||||||
size: 20,
|
size: 20,
|
||||||
Icons.keyboard_arrow_right,
|
Icons.keyboard_arrow_right,
|
||||||
color:
|
color: _blockSettings[index - 1].second ==
|
||||||
_blockSettings[index - 1].second == SkipType.disable
|
SkipType.disable
|
||||||
? Theme.of(context).colorScheme.error
|
? Theme.of(context).colorScheme.error
|
||||||
: Theme.of(context).colorScheme.primary,
|
: Theme.of(context).colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user