mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 02:56:58 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
enum AudioNormalization { disable, dynaudnorm, loudnorm, custom }
|
||||
|
||||
extension AudioNormalizationExt on AudioNormalization {
|
||||
String get title => ['禁用', '预设 dynaudnorm', '预设 loudnorm', '自定义参数'][index];
|
||||
String get param => [
|
||||
String get title =>
|
||||
const ['禁用', '预设 dynaudnorm', '预设 loudnorm', '自定义参数'][index];
|
||||
String get param => const [
|
||||
'',
|
||||
// ref https://github.com/KRTirtho/spotube/commit/da10ab2e291d4ba4d3082b9a6ae535639fb8f1b7
|
||||
'dynaudnorm=g=5:f=250:r=0.9:p=0.5',
|
||||
|
||||
@@ -15,9 +15,9 @@ enum BusinessType {
|
||||
|
||||
extension BusinessTypeExtension on BusinessType {
|
||||
String get type =>
|
||||
['archive', 'pgc', 'live', 'article-list', 'article'][index];
|
||||
const ['archive', 'pgc', 'live', 'article-list', 'article'][index];
|
||||
// 隐藏时长
|
||||
List get hiddenDurationType => ['live', 'article-list', 'article'];
|
||||
List get hiddenDurationType => const ['live', 'article-list', 'article'];
|
||||
// 右上
|
||||
List get showBadge => ['pgc', 'article-list', 'article'];
|
||||
List get showBadge => const ['pgc', 'article-list', 'article'];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final List<Map<String, dynamic>> colorThemeTypes = [
|
||||
{'color': const Color(0xFF5CB67B), 'label': '默认绿'},
|
||||
{'color': const Color(0xFFFF7299), 'label': '粉红色'},
|
||||
const List<Map<String, dynamic>> colorThemeTypes = [
|
||||
{'color': Color(0xFF5CB67B), 'label': '默认绿'},
|
||||
{'color': Color(0xFFFF7299), 'label': '粉红色'},
|
||||
{'color': Colors.red, 'label': '红色'},
|
||||
{'color': Colors.orange, 'label': '橙色'},
|
||||
{'color': Colors.amber, 'label': '琥珀色'},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
enum DynamicBadgeMode { hidden, point, number }
|
||||
|
||||
extension DynamicBadgeModeDesc on DynamicBadgeMode {
|
||||
String get description => ['隐藏', '红点', '数字'][index];
|
||||
String get description => const ['隐藏', '红点', '数字'][index];
|
||||
}
|
||||
|
||||
enum MsgUnReadType { pm, reply, at, like, sysMsg }
|
||||
|
||||
extension MsgUnReadTypeExt on MsgUnReadType {
|
||||
String get title => ['私信', '回复我的', '@我', '收到的赞', '系统通知'][index];
|
||||
String get title => const ['私信', '回复我的', '@我', '收到的赞', '系统通知'][index];
|
||||
}
|
||||
|
||||
@@ -7,39 +7,39 @@ enum DynamicsType {
|
||||
}
|
||||
|
||||
extension BusinessTypeExtension on DynamicsType {
|
||||
String get values => ['all', 'video', 'pgc', 'article', 'up'][index];
|
||||
String get labels => ['全部', '投稿', '番剧', '专栏', 'UP'][index];
|
||||
String get values => const ['all', 'video', 'pgc', 'article', 'up'][index];
|
||||
String get labels => const ['全部', '投稿', '番剧', '专栏', 'UP'][index];
|
||||
}
|
||||
|
||||
List get tabsConfig => [
|
||||
{
|
||||
'tag': 'all',
|
||||
'value': DynamicsType.all,
|
||||
'label': '全部',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'video',
|
||||
'value': DynamicsType.video,
|
||||
'label': '投稿',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'pgc',
|
||||
'value': DynamicsType.pgc,
|
||||
'label': '番剧',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'article',
|
||||
'value': DynamicsType.article,
|
||||
'label': '专栏',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'up',
|
||||
'value': DynamicsType.up,
|
||||
'label': 'UP',
|
||||
'enabled': true,
|
||||
},
|
||||
];
|
||||
const List tabsConfig = [
|
||||
{
|
||||
'tag': 'all',
|
||||
'value': DynamicsType.all,
|
||||
'label': '全部',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'video',
|
||||
'value': DynamicsType.video,
|
||||
'label': '投稿',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'pgc',
|
||||
'value': DynamicsType.pgc,
|
||||
'label': '番剧',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'article',
|
||||
'value': DynamicsType.article,
|
||||
'label': '专栏',
|
||||
'enabled': true,
|
||||
},
|
||||
{
|
||||
'tag': 'up',
|
||||
'value': DynamicsType.up,
|
||||
'label': 'UP',
|
||||
'enabled': true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
List get defaultNavigationBars => [
|
||||
{
|
||||
'id': 0,
|
||||
'icon': const Icon(
|
||||
Icons.home_outlined,
|
||||
size: 23,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.home,
|
||||
size: 23,
|
||||
),
|
||||
'label': "首页",
|
||||
'count': 0,
|
||||
},
|
||||
{
|
||||
'id': 1,
|
||||
'icon': const Icon(
|
||||
Icons.motion_photos_on_outlined,
|
||||
size: 21,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.motion_photos_on,
|
||||
size: 21,
|
||||
),
|
||||
'label': "动态",
|
||||
'count': 0,
|
||||
},
|
||||
{
|
||||
'id': 2,
|
||||
'icon': const Icon(
|
||||
Icons.video_collection_outlined,
|
||||
size: 21,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.video_collection,
|
||||
size: 21,
|
||||
),
|
||||
'label': "媒体库",
|
||||
'count': 0,
|
||||
}
|
||||
];
|
||||
List defaultNavigationBars = [
|
||||
{
|
||||
'id': 0,
|
||||
'icon': const Icon(
|
||||
Icons.home_outlined,
|
||||
size: 23,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.home,
|
||||
size: 23,
|
||||
),
|
||||
'label': "首页",
|
||||
'count': 0,
|
||||
},
|
||||
{
|
||||
'id': 1,
|
||||
'icon': const Icon(
|
||||
Icons.motion_photos_on_outlined,
|
||||
size: 21,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.motion_photos_on,
|
||||
size: 21,
|
||||
),
|
||||
'label': "动态",
|
||||
'count': 0,
|
||||
},
|
||||
{
|
||||
'id': 2,
|
||||
'icon': const Icon(
|
||||
Icons.video_collection_outlined,
|
||||
size: 21,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.video_collection,
|
||||
size: 21,
|
||||
),
|
||||
'label': "媒体库",
|
||||
'count': 0,
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
enum ReplySortType { time, like }
|
||||
|
||||
extension ReplySortTypeExtension on ReplySortType {
|
||||
String get title => ['最新评论', '最热评论'][index];
|
||||
String get label => ['最新', '最热'][index];
|
||||
String get title => const ['最新评论', '最热评论'][index];
|
||||
String get label => const ['最新', '最热'][index];
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ enum SearchType {
|
||||
}
|
||||
|
||||
extension SearchTypeExtension on SearchType {
|
||||
String get label => [
|
||||
String get label => const [
|
||||
// '综合',
|
||||
'视频',
|
||||
'番剧',
|
||||
@@ -49,5 +49,5 @@ enum ArchiveFilterType {
|
||||
|
||||
extension ArchiveFilterTypeExtension on ArchiveFilterType {
|
||||
String get description =>
|
||||
['默认排序', '播放多', '新发布', '弹幕多', '收藏多', '评论多', '最多喜欢'][index];
|
||||
const ['默认排序', '播放多', '新发布', '弹幕多', '收藏多', '评论多', '最多喜欢'][index];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
enum ActionType { skip, mute, full, poi }
|
||||
|
||||
extension ActionTypeExt on ActionType {
|
||||
String get title => ['跳过', '静音', '整个视频', '精彩时刻'][index];
|
||||
String get title => const ['跳过', '静音', '整个视频', '精彩时刻'][index];
|
||||
}
|
||||
|
||||
@@ -47,45 +47,9 @@ enum SegmentType {
|
||||
// };
|
||||
// }
|
||||
|
||||
List<ActionType> segmentType2ActionType(SegmentType segmentType) {
|
||||
return switch (segmentType) {
|
||||
SegmentType.sponsor => [ActionType.skip, ActionType.mute, ActionType.full],
|
||||
SegmentType.selfpromo => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full
|
||||
],
|
||||
SegmentType.interaction => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.intro => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.outro => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.preview => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.music_offtopic => [
|
||||
ActionType.skip,
|
||||
],
|
||||
SegmentType.poi_highlight => [ActionType.poi],
|
||||
SegmentType.filler => [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.exclusive_access => [ActionType.full],
|
||||
};
|
||||
}
|
||||
|
||||
extension SegmentTypeExt on SegmentType {
|
||||
/// from https://github.com/hanydd/BilibiliSponsorBlock/blob/master/public/_locales/zh_CN/messages.json
|
||||
String get title => [
|
||||
String get title => const [
|
||||
'赞助广告', //sponsor
|
||||
'无偿/自我推广', //selfpromo
|
||||
'三连/订阅提醒', //interaction
|
||||
@@ -98,7 +62,7 @@ extension SegmentTypeExt on SegmentType {
|
||||
'柔性推广/品牌合作', //exclusive_access
|
||||
][index];
|
||||
|
||||
String get shortTitle => [
|
||||
String get shortTitle => const [
|
||||
'赞助广告', //sponsor
|
||||
'推广', //selfpromo
|
||||
'订阅提醒', //interaction
|
||||
@@ -111,7 +75,7 @@ extension SegmentTypeExt on SegmentType {
|
||||
'品牌合作', //exclusive_access
|
||||
][index];
|
||||
|
||||
String get description => [
|
||||
String get description => const [
|
||||
'付费推广、付费推荐和直接广告。不是自我推广或免费提及他们喜欢的商品/创作者/网站/产品。', //sponsor
|
||||
'类似于 “赞助广告” ,但无报酬或是自我推广。包括有关商品、捐赠的部分或合作者的信息。', //selfpromo
|
||||
'视频中间简短提醒观众来一键三连或关注。 如果片段较长,或是有具体内容,则应分类为自我推广。', //interaction
|
||||
@@ -124,7 +88,7 @@ extension SegmentTypeExt on SegmentType {
|
||||
'仅用于对整个视频进行标记。适用于展示UP主免费或获得补贴后使用的产品、服务或场地的视频。', //exclusive_access
|
||||
][index];
|
||||
|
||||
Color get color => [
|
||||
Color get color => const [
|
||||
Color(0xFF00d400), //sponsor
|
||||
Color(0xFFffff00), //selfpromo
|
||||
Color(0xFFcc00ff), //interaction
|
||||
@@ -136,4 +100,44 @@ extension SegmentTypeExt on SegmentType {
|
||||
Color(0xFF7300FF), //filler
|
||||
Color(0xFF008a5c), //exclusive_access
|
||||
][index];
|
||||
|
||||
List<ActionType> get toActionType {
|
||||
return switch (this) {
|
||||
SegmentType.sponsor => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full
|
||||
],
|
||||
SegmentType.selfpromo => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full
|
||||
],
|
||||
SegmentType.interaction => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.intro => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.outro => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.preview => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.music_offtopic => const [
|
||||
ActionType.skip,
|
||||
],
|
||||
SegmentType.poi_highlight => const [ActionType.poi],
|
||||
SegmentType.filler => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.exclusive_access => const [ActionType.full],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
enum SkipType { alwaysSkip, skipOnce, skipManually, showOnly, disable }
|
||||
|
||||
extension SkipTypeExt on SkipType {
|
||||
String get title => ['总是跳过', '跳过一次', '手动跳过', '仅显示', '禁用'][index];
|
||||
String get title => const ['总是跳过', '跳过一次', '手动跳过', '仅显示', '禁用'][index];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
enum SuperResolutionType { disable, efficiency, quality }
|
||||
|
||||
extension SuperResolutionTypeExt on SuperResolutionType {
|
||||
String get title => ['禁用', '效率', '画质'][index];
|
||||
String get title => const ['禁用', '效率', '画质'][index];
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
enum TabType { live, rcmd, hot, rank, bangumi, cinema }
|
||||
|
||||
extension TabTypeDesc on TabType {
|
||||
String get description => ['直播', '推荐', '热门', '分区', '番剧', '影视'][index];
|
||||
String get description => const ['直播', '推荐', '热门', '分区', '番剧', '影视'][index];
|
||||
}
|
||||
|
||||
List get tabsConfig => [
|
||||
|
||||
@@ -8,7 +8,7 @@ enum ThemeType {
|
||||
}
|
||||
|
||||
extension ThemeTypeExt on ThemeType {
|
||||
String get description => ['浅色', '深色', '跟随系统'][index];
|
||||
String get description => const ['浅色', '深色', '跟随系统'][index];
|
||||
|
||||
int get code => index;
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ enum UpPanelPosition {
|
||||
}
|
||||
|
||||
extension UpPanelPositionDesc on UpPanelPosition {
|
||||
String get labels => ['左侧常驻', '右侧常驻', '左侧抽屉', '右侧抽屉'][index];
|
||||
String get labels => const ['左侧常驻', '右侧常驻', '左侧抽屉', '右侧抽屉'][index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user