From 706c13462755ed230c7e55be62bb4b253299302c Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 17 Apr 2024 23:53:00 +0800 Subject: [PATCH 1/2] Update beta_ci.yml --- .github/workflows/beta_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta_ci.yml b/.github/workflows/beta_ci.yml index 40f3f042..14b51780 100644 --- a/.github/workflows/beta_ci.yml +++ b/.github/workflows/beta_ci.yml @@ -206,4 +206,4 @@ jobs: method: sendFile path: Pilipala-Beta/* parse_mode: Markdown - context: "*Beta版本: v${{ needs.update_version.outputs.new_version }}*\n更新内容: [${{ needs.update_version.outputs.last_commit }}](${{ github.event.head_commit.url }})" + context: "*Beta版本: v${{ needs.update_version.outputs.new_version }}*\n更新内容: [${{ needs.update_version.outputs.last_commit }}]" From 7fc2765471f74fd0f1fdc7ac89fab506a7d6a9a7 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Thu, 18 Apr 2024 00:00:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?opt:=20=E5=AD=97=E5=B9=95=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/common/subtitle_type.dart | 16 ++++++++++++++++ .../video/detail/widgets/header_control.dart | 14 -------------- lib/utils/subtitle.dart | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/models/common/subtitle_type.dart b/lib/models/common/subtitle_type.dart index 11716351..54b52e8e 100644 --- a/lib/models/common/subtitle_type.dart +++ b/lib/models/common/subtitle_type.dart @@ -5,6 +5,10 @@ enum SubtitleType { aizh, // 英语(自动生成) aien, + // 中文(简体) + zhHans, + // 英文(美国) + enUS, } extension SubtitleTypeExtension on SubtitleType { @@ -16,6 +20,10 @@ extension SubtitleTypeExtension on SubtitleType { return '中文(自动翻译)'; case SubtitleType.aien: return '英语(自动生成)'; + case SubtitleType.zhHans: + return '中文(简体)'; + case SubtitleType.enUS: + return '英文(美国)'; } } } @@ -29,6 +37,10 @@ extension SubtitleIdExtension on SubtitleType { return 'ai-zh'; case SubtitleType.aien: return 'ai-en'; + case SubtitleType.zhHans: + return 'zh-Hans'; + case SubtitleType.enUS: + return 'en-US'; } } } @@ -42,6 +54,10 @@ extension SubtitleCodeExtension on SubtitleType { return 2; case SubtitleType.aien: return 3; + case SubtitleType.zhHans: + return 4; + case SubtitleType.enUS: + return 5; } } } diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index e6a324cb..e00311c5 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -1306,20 +1306,6 @@ class _HeaderControlState extends State { ], /// 字幕 - // SizedBox( - // width: 34, - // height: 34, - // child: IconButton( - // style: ButtonStyle( - // padding: MaterialStateProperty.all(EdgeInsets.zero), - // ), - // onPressed: () => showSubtitleDialog(), - // icon: const Icon( - // Icons.closed_caption_off, - // size: 22, - // ), - // ), - // ), ComBtn( icon: const Icon( Icons.closed_caption_off, diff --git a/lib/utils/subtitle.dart b/lib/utils/subtitle.dart index 452be542..1b4088f3 100644 --- a/lib/utils/subtitle.dart +++ b/lib/utils/subtitle.dart @@ -5,8 +5,8 @@ class SubTitleUtils { for (int i = 0; i < jsonData.length; i++) { final item = jsonData[i]; - double from = item['from'] as double; - double to = item['to'] as double; + double from = double.parse(item['from'].toString()); + double to = double.parse(item['to'].toString()); int sid = (item['sid'] ?? 0) as int; String content = item['content'] as String;