Skip to content

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

集数表现形式修改,macOS表现优化

ErBW_sec079ac9d62d
diff --git a/lib/main.dart b/lib/main.dart
index ad0ab651..988794df 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -17,18 +17,33 @@ void main() async {
if (Utils.isDesktop()) {
await windowManager.ensureInitialized();
bool isLowResolution = await Utils.isLowResolution();
- WindowOptions windowOptions = WindowOptions(
- size: isLowResolution ? const Size(800, 600) : const Size(1280, 860),
- center: true,
- // backgroundColor: Colors.white,
- skipTaskbar: false,
- titleBarStyle: TitleBarStyle.hidden,
- windowButtonVisibility: false,
- );
- windowManager.waitUntilReadyToShow(windowOptions, () async {
- await windowManager.show();
- await windowManager.focus();
- });
+ if (Platform.isMacOS) {
+ WindowOptions windowOptions = const WindowOptions(
+ size: Size(1400, 900),
+ center: true,
+ // backgroundColor: Colors.white,
+ skipTaskbar: false,
+ titleBarStyle: TitleBarStyle.hidden,
+ windowButtonVisibility: false,
+ );
+ windowManager.waitUntilReadyToShow(windowOptions, () async {
+ await windowManager.show();
+ await windowManager.focus();
+ });
+ } else {
+ WindowOptions windowOptions = WindowOptions(
+ size: isLowResolution ? const Size(800, 600) : const Size(1280, 860),
+ center: true,
+ // backgroundColor: Colors.white,
+ skipTaskbar: false,
+ titleBarStyle: TitleBarStyle.hidden,
+ windowButtonVisibility: false,
+ );
+ windowManager.waitUntilReadyToShow(windowOptions, () async {
+ await windowManager.show();
+ await windowManager.focus();
+ });
+ }
}
if (Platform.isAndroid || Platform.isIOS) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
diff --git a/lib/modules/roads/road_module.dart b/lib/modules/roads/road_module.dart
index 818d2214..ecc1f546 100644
--- a/lib/modules/roads/road_module.dart
+++ b/lib/modules/roads/road_module.dart
@@ -1,9 +1,11 @@
class Road {
String name;
List<String> data;
+ List<String> identifier;
Road({
required this.name,
required this.data,
+ required this.identifier,
});
}
\ No newline at end of file
diff --git a/lib/pages/player/player_item.dart b/lib/pages/player/player_item.dart
index 5acee186..da9021c8 100644
--- a/lib/pages/player/player_item.dart
+++ b/lib/pages/player/player_item.dart
@@ -290,7 +290,7 @@ class _PlayerItemState extends State<PlayerItem>
.roadList[videoPageController.currentRoad].data.length &&
!videoPageController.loading) {
SmartDialog.showToast(
- '正在加载第 ${videoPageController.currentEspisode + 1} 话');
+ '正在加载${videoPageController.roadList[videoPageController.currentRoad].identifier[videoPageController.currentEspisode]}');
try {
playerTimer!.cancel();
} catch (_) {}
diff --git a/lib/pages/video/video_controller.dart b/lib/pages/video/video_controller.dart
index 61a8b412..4076de29 100644
--- a/lib/pages/video/video_controller.dart
+++ b/lib/pages/video/video_controller.dart
@@ -59,7 +59,8 @@ abstract class _VideoPageController with Store {
currentEspisode = episode;
this.currentRoad = currentRoad;
logLines.clear();
- KazumiLogger().log(Level.info, '跳转到第$episode话');
+ String chapterName = roadList[currentRoad].identifier[episode - 1];
+ KazumiLogger().log(Level.info, '跳转到$chapterName');
String urlItem = roadList[currentRoad].data[episode - 1];
if (urlItem.contains(currentPlugin.baseUrl) ||
urlItem.contains(currentPlugin.baseUrl.replaceAll('https', 'http'))) {
diff --git a/lib/pages/video/video_page.dart b/lib/pages/video/video_page.dart
index 539462f2..c94bb91a 100644
--- a/lib/pages/video/video_page.dart
+++ b/lib/pages/video/video_page.dart
@@ -421,7 +421,7 @@ class _VideoPageState extends State<VideoPage>
const SizedBox(width: 6)
],
Text(
- '第$count话',
+ road.identifier[count0 - 1],
style: TextStyle(
fontSize: 13,
color: (count0 ==
diff --git a/lib/plugins/plugins.dart b/lib/plugins/plugins.dart
index 22595a72..98d31424 100644
--- a/lib/plugins/plugins.dart
+++ b/lib/plugins/plugins.dart
@@ -186,12 +186,15 @@ class Plugin {
htmlElement.queryXPath(chapterRoads).nodes.forEach((element) {
try {
List<String> chapterUrlList = [];
+ List<String> chapterNameList = [];
element.queryXPath(chapterResult).nodes.forEach((item) {
String itemUrl = item.node.attributes['href'] ?? '';
+ String itemName = item.node.text ?? '';
chapterUrlList.add(itemUrl);
+ chapterNameList.add(itemName);
});
- if (chapterUrlList.isNotEmpty) {
- Road road = Road(name: '播放列表$count', data: chapterUrlList);
+ if (chapterUrlList.isNotEmpty && chapterNameList.isNotEmpty) {
+ Road road = Road(name: '播放列表$count', data: chapterUrlList, identifier: chapterNameList);
roadList.add(road);
count++;
}