Skip to content

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

fix history mismatch (#286) & add episode parser func

Predidita772c8ba0f92
diff --git a/lib/bean/card/bangumi_history_card.dart b/lib/bean/card/bangumi_history_card.dart
index 23a9a6b1..24b48821 100644
--- a/lib/bean/card/bangumi_history_card.dart
+++ b/lib/bean/card/bangumi_history_card.dart
@@ -70,6 +70,7 @@ class _BangumiHistoryCardVState extends State<BangumiHistoryCardV> {
widget.historyItem.bangumiItem.nameCn == ''
? widget.historyItem.bangumiItem.name
: widget.historyItem.bangumiItem.nameCn;
+ videoPageController.src = widget.historyItem.lastSrc;
try {
await infoController.queryRoads(widget.historyItem.lastSrc,
videoPageController.currentPlugin.name);
diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart
index 88974539..f393e3f0 100644
--- a/lib/utils/utils.dart
+++ b/lib/utils/utils.dart
@@ -442,6 +442,17 @@ class Utils {
return color;
}
+ static int extractEpisodeNumber(String input) {
+ RegExp regExp = RegExp(r'第?(\d+)[话集]?');
+ Match? match = regExp.firstMatch(input);
+
+ if (match != null && match.group(1) != null) {
+ return int.tryParse(match.group(1)!) ?? 0;
+ }
+
+ return 0;
+ }
+
/// 判断是否为桌面设备
static bool isDesktop() {
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
@@ -601,7 +612,8 @@ class Utils {
// 获取当前解复用器
static Future<String> getCurrentDemux() async {
Box setting = GStorage.setting;
- bool haEnable = await setting.get(SettingBoxKey.hAenable, defaultValue: true);
+ bool haEnable =
+ await setting.get(SettingBoxKey.hAenable, defaultValue: true);
if ((Platform.isIOS || Platform.isMacOS) && haEnable) {
return 'AVPlayer';
}