mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
opt type
opt ua opt subtitle opt playertype Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
13
lib/models/common/setting_type.dart
Normal file
13
lib/models/common/setting_type.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
enum SettingType {
|
||||
privacySetting('隐私设置'),
|
||||
recommendSetting('推荐流设置'),
|
||||
videoSetting('音视频设置'),
|
||||
playSetting('播放器设置'),
|
||||
styleSetting('外观设置'),
|
||||
extraSetting('其它设置'),
|
||||
webdavSetting('WebDAV 设置'),
|
||||
about('关于');
|
||||
|
||||
final String title;
|
||||
const SettingType(this.title);
|
||||
}
|
||||
@@ -1,21 +1,9 @@
|
||||
enum SubtitlePrefType { off, on, withoutAi, auto }
|
||||
enum SubtitlePrefType {
|
||||
off('默认不显示字幕'),
|
||||
on('优先选择非自动生成(ai)字幕'),
|
||||
withoutAi('跳过自动生成(ai)字幕,选择第一个可用字幕'),
|
||||
auto('静音时等同第二项,非静音时等同第三项');
|
||||
|
||||
extension SubtitlePrefTypeExt on SubtitlePrefType {
|
||||
String get description => const [
|
||||
'默认不显示字幕',
|
||||
'优先选择非自动生成(ai)字幕',
|
||||
'跳过自动生成(ai)字幕,选择第一个可用字幕',
|
||||
'静音时等同第二项,非静音时等同第三项',
|
||||
][index];
|
||||
|
||||
static const List<String> _codeList = ['off', 'on', 'withoutAi', 'auto'];
|
||||
String get code => _codeList[index];
|
||||
|
||||
static SubtitlePrefType? fromCode(String code) {
|
||||
final index = _codeList.indexOf(code);
|
||||
if (index != -1) {
|
||||
return SubtitlePrefType.values[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
final String desc;
|
||||
const SubtitlePrefType(this.desc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user