feat: SponsorBlock switch
This commit is contained in:
@ -199,6 +199,15 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
GlobalDataCache.enableDlna = val;
|
||||
},
|
||||
),
|
||||
SetSwitchItem(
|
||||
title: 'Sponsor Block',
|
||||
subTitle: '自动跳过视频中赞助片段',
|
||||
setKey: SettingBoxKey.enableSponsorBlock,
|
||||
defaultVal: false,
|
||||
callFn: (bool val) {
|
||||
GlobalDataCache.enableSponsorBlock = val;
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
title: Text('评论展示', style: titleStyle),
|
||||
|
||||
@ -21,6 +21,7 @@ import 'package:pilipala/models/video/play/url.dart';
|
||||
import 'package:pilipala/models/video/reply/item.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply_reply/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
import 'package:pilipala/utils/video_utils.dart';
|
||||
@ -198,7 +199,7 @@ class VideoDetailController extends GetxController
|
||||
});
|
||||
|
||||
/// 仅投稿视频skip
|
||||
if (videoType == SearchType.video) {
|
||||
if (videoType == SearchType.video && GlobalDataCache.enableSponsorBlock) {
|
||||
querySkipSegments();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user