mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 16:48:16 +08:00
opt: continuePlayingPart
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1573,6 +1573,13 @@ List<SettingsModel> get extraSettings => [
|
||||
needReboot: true,
|
||||
setKey: SettingBoxKey.badCertificateCallback,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '显示继续播放分P提示',
|
||||
leading: Icon(Icons.local_parking),
|
||||
setKey: SettingBoxKey.continuePlayingPart,
|
||||
defaultVal: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
enableFeedback: true,
|
||||
|
||||
@@ -1830,9 +1830,9 @@ class VideoDetailController extends GetxController
|
||||
};
|
||||
}
|
||||
|
||||
List<Map<String, String>> _vttSubtitles = <Map<String, String>>[];
|
||||
late List<Map<String, String>> _vttSubtitles = <Map<String, String>>[];
|
||||
int? vttSubtitlesIndex;
|
||||
bool showVP = true;
|
||||
late bool showVP = true;
|
||||
|
||||
void _getSubtitle() {
|
||||
_vttSubtitles.clear();
|
||||
@@ -1865,12 +1865,16 @@ class VideoDetailController extends GetxController
|
||||
});
|
||||
}
|
||||
|
||||
late bool continuePlayingPart = GStorage.continuePlayingPart;
|
||||
|
||||
Future _querySubtitles() async {
|
||||
Map res = await VideoHttp.subtitlesJson(bvid: bvid, cid: cid.value);
|
||||
// if (!res["status"]) {
|
||||
// SmartDialog.showToast('查询字幕错误,${res["msg"]}');
|
||||
// }
|
||||
if (res['status']) {
|
||||
if (continuePlayingPart) {
|
||||
continuePlayingPart = false;
|
||||
try {
|
||||
VideoIntroController videoIntroController =
|
||||
Get.find<VideoIntroController>(tag: heroTag);
|
||||
@@ -1900,8 +1904,8 @@ class VideoDetailController extends GetxController
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 4),
|
||||
margin: const EdgeInsets.only(bottom: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||
@@ -1911,8 +1915,9 @@ class VideoDetailController extends GetxController
|
||||
'上次看到第${index + 1}P,点击跳转',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSecondaryContainer,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1922,6 +1927,7 @@ class VideoDetailController extends GetxController
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
vttSubtitlesIndex = 0;
|
||||
if (res["data"] is List && res["data"].isNotEmpty) {
|
||||
|
||||
@@ -287,6 +287,9 @@ class GStorage {
|
||||
static bool get badCertificateCallback =>
|
||||
setting.get(SettingBoxKey.badCertificateCallback, defaultValue: false);
|
||||
|
||||
static bool get continuePlayingPart =>
|
||||
setting.get(SettingBoxKey.continuePlayingPart, defaultValue: true);
|
||||
|
||||
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
||||
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
||||
|
||||
@@ -495,6 +498,7 @@ class SettingBoxKey {
|
||||
subtitleBgOpaticy = 'subtitleBgOpaticy',
|
||||
subtitleBgStroke = 'subtitleBgStroke',
|
||||
badCertificateCallback = 'badCertificateCallback',
|
||||
continuePlayingPart = 'continuePlayingPart',
|
||||
|
||||
// Sponsor Block
|
||||
enableSponsorBlock = 'enableSponsorBlock',
|
||||
|
||||
Reference in New Issue
Block a user