mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-15 23:10:09 +08:00
@@ -118,22 +118,16 @@ class LanguageItem {
|
||||
this.lang,
|
||||
this.title,
|
||||
this.subtitleLang,
|
||||
this.videoDetext,
|
||||
this.videoMouthShapeChange,
|
||||
});
|
||||
|
||||
String? lang;
|
||||
String? title;
|
||||
String? subtitleLang;
|
||||
bool? videoDetext;
|
||||
bool? videoMouthShapeChange;
|
||||
|
||||
LanguageItem.fromJson(Map<String, dynamic> json) {
|
||||
lang = json['lang'];
|
||||
title = json['title'];
|
||||
title = '${json['title']}${json['production_type'] == 2 ? '(AI)' : ''}';
|
||||
subtitleLang = json['subtitle_lang'];
|
||||
videoDetext = json['video_detext'];
|
||||
videoMouthShapeChange = json['video_mouth_shape_change'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1226,6 +1226,7 @@ class VideoDetailController extends GetxController
|
||||
final Rx<List<LanguageItem>?> languages = Rx<List<LanguageItem>?>(null);
|
||||
final Rx<String?> currLang = Rx<String?>(null);
|
||||
void setLanguage(String language) {
|
||||
if (currLang.value == language) return;
|
||||
if (!isLoginVideo) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
|
||||
@@ -324,7 +324,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
leading: const Icon(Icons.hourglass_top_outlined, size: 20),
|
||||
title: const Text('定时关闭', style: titleStyle),
|
||||
),
|
||||
if (!isFileSource)
|
||||
if (!isFileSource) ...[
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
@@ -337,7 +337,6 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
title: const Text('播放地址', style: titleStyle),
|
||||
),
|
||||
if (!isFileSource)
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
@@ -350,6 +349,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
leading: const Icon(Icons.refresh_outlined, size: 20),
|
||||
title: const Text('重载视频', style: titleStyle),
|
||||
),
|
||||
],
|
||||
ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(
|
||||
|
||||
@@ -608,27 +608,35 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final list = videoDetailController.languages.value;
|
||||
if (list != null && list.isNotEmpty) {
|
||||
return PopupMenuButton<String>(
|
||||
tooltip: '原声翻译',
|
||||
tooltip: '翻译',
|
||||
requestFocus: false,
|
||||
initialValue: videoDetailController.currLang.value,
|
||||
color: Colors.black.withValues(alpha: 0.8),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem<String>(
|
||||
height: 35,
|
||||
value: '',
|
||||
onTap: () => videoDetailController.setLanguage(''),
|
||||
child: const Text(
|
||||
"关闭翻译",
|
||||
style: TextStyle(color: Colors.white),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
),
|
||||
...list.map((e) {
|
||||
return PopupMenuItem<String>(
|
||||
height: 35,
|
||||
value: e.lang,
|
||||
onTap: () => videoDetailController.setLanguage(e.lang!),
|
||||
child: Text(
|
||||
e.title!,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -93,8 +93,7 @@ class DownloadManager {
|
||||
_status = DownloadStatus.completed;
|
||||
onTaskComplete();
|
||||
}
|
||||
closeAndDelete(delete: isFailed);
|
||||
_complete();
|
||||
closeAndDelete(delete: isFailed).whenComplete(_complete);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +174,10 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
sha256: a9461b8e586bf018dd4afd2e13b49b08c6a844a4b226c8d1d10f3a723cdd78c3
|
||||
sha256: "04f69b1502f66e22ae7990bbd01eb552b7f12793c4d3ea6e715d0ac5e98bcdac"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.1"
|
||||
version: "2.10.2"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user