mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
committed by
GitHub
parent
1da30d5d8f
commit
a915650bb6
@@ -1,10 +1,9 @@
|
||||
enum AccountType {
|
||||
main,
|
||||
heartbeat,
|
||||
recommend,
|
||||
video,
|
||||
}
|
||||
main('主账号'),
|
||||
heartbeat('记录观看'),
|
||||
recommend('推荐'),
|
||||
video('视频取流');
|
||||
|
||||
extension AccountTypeExt on AccountType {
|
||||
String get title => const ['主账号', '记录观看', '推荐', '视频取流'][index];
|
||||
final String title;
|
||||
const AccountType(this.title);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
enum AudioNormalization { disable, dynaudnorm, loudnorm, custom }
|
||||
enum AudioNormalization {
|
||||
disable('禁用'),
|
||||
// ref https://github.com/KRTirtho/spotube/commit/da10ab2e291d4ba4d3082b9a6ae535639fb8f1b7
|
||||
dynaudnorm('预设 dynaudnorm', 'dynaudnorm=g=5:f=250:r=0.9:p=0.5'),
|
||||
loudnorm('预设 loudnorm', 'loudnorm=I=-16:LRA=11:TP=-1.5'),
|
||||
custom('自定义参数');
|
||||
|
||||
extension AudioNormalizationExt on AudioNormalization {
|
||||
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',
|
||||
'loudnorm=I=-16:LRA=11:TP=-1.5',
|
||||
'',
|
||||
][index];
|
||||
final String title;
|
||||
final String param;
|
||||
const AudioNormalization(this.title, [this.param = '']);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum BadgeType { none, vip, person, institution }
|
||||
enum BadgeType {
|
||||
none(),
|
||||
vip('大会员'),
|
||||
person('认证个人', Color(0xFFFFCC00)),
|
||||
institution('认证机构', Colors.lightBlueAccent);
|
||||
|
||||
extension BadgeTypeExt on BadgeType {
|
||||
String get desc => const ['', '大会员', '认证个人', '认证机构'][index];
|
||||
Color get color => const [
|
||||
Colors.transparent,
|
||||
Color(0xFFFF6699),
|
||||
Color(0xFFFFCC00),
|
||||
Colors.lightBlueAccent
|
||||
][index];
|
||||
final String? desc;
|
||||
final Color? color;
|
||||
const BadgeType([this.desc, this.color]);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
enum EpisodeType { part, season, bangumi }
|
||||
enum EpisodeType {
|
||||
part('分P'),
|
||||
season('合集'),
|
||||
bangumi('番剧');
|
||||
|
||||
extension EpisodeTypeExt on EpisodeType {
|
||||
String get title => const ['分P', '合集', '番剧'][index];
|
||||
final String title;
|
||||
const EpisodeType(this.title);
|
||||
}
|
||||
|
||||
@@ -4,16 +4,14 @@ import 'package:PiliPlus/pages/fav/pgc/view.dart';
|
||||
import 'package:PiliPlus/pages/fav/video/view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum FavTabType { video, bangumi, cinema, article, note }
|
||||
enum FavTabType {
|
||||
video('视频', FavVideoPage()),
|
||||
bangumi('追番', FavPgcPage(type: 1)),
|
||||
cinema('追剧', FavPgcPage(type: 2)),
|
||||
article('专栏', FavArticlePage()),
|
||||
note('笔记', FavNotePage());
|
||||
|
||||
extension FavTabTypeExt on FavTabType {
|
||||
String get title => const ['视频', '追番', '追剧', '专栏', '笔记'][index];
|
||||
|
||||
Widget get page => switch (this) {
|
||||
FavTabType.video => const FavVideoPage(),
|
||||
FavTabType.bangumi => const FavPgcPage(type: 1),
|
||||
FavTabType.cinema => const FavPgcPage(type: 2),
|
||||
FavTabType.article => const FavArticlePage(),
|
||||
FavTabType.note => const FavNotePage(),
|
||||
};
|
||||
final String title;
|
||||
final Widget page;
|
||||
const FavTabType(this.title, this.page);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
enum FollowOrderType { def, attention }
|
||||
enum FollowOrderType {
|
||||
def('', '最近关注'),
|
||||
attention('attention', '最常访问');
|
||||
|
||||
extension FollowOrderTypeExt on FollowOrderType {
|
||||
String get type => const ['', 'attention'][index];
|
||||
String get title => const ['最近关注', '最常访问'][index];
|
||||
final String type;
|
||||
final String title;
|
||||
|
||||
const FollowOrderType(this.type, this.title);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
enum HistoryBusinessType {
|
||||
// 普通视频
|
||||
archive,
|
||||
archive('archive'),
|
||||
// 剧集(番剧 / 影视)
|
||||
pgc,
|
||||
pgc('pgc'),
|
||||
// 直播
|
||||
live,
|
||||
live('live'),
|
||||
// 文章
|
||||
articleList,
|
||||
articleList('article-list'),
|
||||
// 文章
|
||||
article,
|
||||
hiddenDurationType,
|
||||
showBadge
|
||||
}
|
||||
article('article');
|
||||
|
||||
extension HistoryBusinessTypeExt on HistoryBusinessType {
|
||||
String get type =>
|
||||
const ['archive', 'pgc', 'live', 'article-list', 'article'][index];
|
||||
// 隐藏时长
|
||||
List get hiddenDurationType => const ['live', 'article-list', 'article'];
|
||||
static const hiddenDurationType = {'live', 'article-list', 'article'};
|
||||
// 右上
|
||||
List get showBadge => const ['pgc', 'article-list', 'article'];
|
||||
static const showBadge = {'pgc', 'article-list', 'article'};
|
||||
|
||||
final String type;
|
||||
const HistoryBusinessType(this.type);
|
||||
}
|
||||
|
||||
@@ -12,10 +12,16 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
enum HomeTabType { live, rcmd, hot, rank, bangumi, cinema }
|
||||
enum HomeTabType {
|
||||
live('直播'),
|
||||
rcmd('推荐'),
|
||||
hot('热门'),
|
||||
rank('分区'),
|
||||
bangumi('番剧'),
|
||||
cinema('影视');
|
||||
|
||||
extension HomeTabTypeExt on HomeTabType {
|
||||
String get description => const ['直播', '推荐', '热门', '分区', '番剧', '影视'][index];
|
||||
final String description;
|
||||
const HomeTabType(this.description);
|
||||
}
|
||||
|
||||
List get homeTabsConfig => [
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import 'package:PiliPlus/pages/later/child_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum LaterViewType { all, toView, unfinished, viewed }
|
||||
enum LaterViewType {
|
||||
all('全部'),
|
||||
toView('未看'),
|
||||
unfinished('未看完'),
|
||||
viewed('已看完');
|
||||
|
||||
extension LaterViewTypeExt on LaterViewType {
|
||||
int get type => index;
|
||||
|
||||
String get title => const ['全部', '未看', '未看完', '已看完'][index];
|
||||
|
||||
Widget get page => LaterViewChildPage(laterViewType: this);
|
||||
|
||||
final String title;
|
||||
const LaterViewType(this.title);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// enum NavigationBarType {
|
||||
// home(
|
||||
// '首页',
|
||||
// Icon(Icons.home_outlined, size: 23),
|
||||
// Icon(Icons.home, size: 21),
|
||||
// ),
|
||||
// dynamics(
|
||||
// '动态',
|
||||
// Icon(Icons.motion_photos_on_outlined, size: 21),
|
||||
// Icon(Icons.motion_photos_on, size: 21),
|
||||
// ),
|
||||
// media(
|
||||
// '媒体库',
|
||||
// Icon(Icons.video_collection_outlined, size: 21),
|
||||
// Icon(Icons.video_collection, size: 21),
|
||||
// );
|
||||
|
||||
// final Icon icon;
|
||||
// final Icon selectIcon;
|
||||
// final String label;
|
||||
|
||||
// const NavigationBarType(this.label, this.icon, this.selectIcon);
|
||||
// }
|
||||
|
||||
// TODO enum
|
||||
List defaultNavigationBars = [
|
||||
{
|
||||
'id': 0,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// TODO named record or enum
|
||||
const List rankTabsConfig = [
|
||||
{
|
||||
'rid': 0,
|
||||
|
||||
@@ -2,52 +2,41 @@
|
||||
enum SearchType {
|
||||
// all,
|
||||
// 视频:video
|
||||
video,
|
||||
video('视频'),
|
||||
// 番剧:media_bangumi,
|
||||
media_bangumi,
|
||||
media_bangumi('番剧'),
|
||||
// 影视:media_ft
|
||||
media_ft,
|
||||
media_ft('影视'),
|
||||
// 直播间及主播:live
|
||||
// live,
|
||||
// 直播间:live_room
|
||||
live_room,
|
||||
live_room('直播间'),
|
||||
// 主播:live_user
|
||||
// live_user,
|
||||
// 话题:topic
|
||||
// topic,
|
||||
// 用户:bili_user
|
||||
bili_user,
|
||||
bili_user('用户'),
|
||||
// 专栏:article
|
||||
article,
|
||||
article('专栏');
|
||||
// 相簿:photo
|
||||
// photo
|
||||
}
|
||||
|
||||
extension SearchTypeExtension on SearchType {
|
||||
String get label => const [
|
||||
// '综合',
|
||||
'视频',
|
||||
'番剧',
|
||||
'影视',
|
||||
'直播间',
|
||||
'用户',
|
||||
'专栏',
|
||||
][index];
|
||||
final String label;
|
||||
const SearchType(this.label);
|
||||
}
|
||||
|
||||
// 搜索类型为视频、专栏及相簿时
|
||||
enum ArchiveFilterType {
|
||||
totalrank,
|
||||
click,
|
||||
pubdate,
|
||||
dm,
|
||||
stow,
|
||||
scores,
|
||||
totalrank('默认排序'),
|
||||
click('播放多'),
|
||||
pubdate('新发布'),
|
||||
dm('弹幕多'),
|
||||
stow('收藏多'),
|
||||
scores('评论多');
|
||||
// 专栏
|
||||
// attention,
|
||||
}
|
||||
// attention('最多喜欢'),
|
||||
|
||||
extension ArchiveFilterTypeExtension on ArchiveFilterType {
|
||||
String get description =>
|
||||
const ['默认排序', '播放多', '新发布', '弹幕多', '收藏多', '评论多', '最多喜欢'][index];
|
||||
final String description;
|
||||
const ArchiveFilterType(this.description);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
enum SuperResolutionType { disable, efficiency, quality }
|
||||
enum SuperResolutionType {
|
||||
disable('禁用'),
|
||||
efficiency('效率'),
|
||||
quality('画质');
|
||||
|
||||
extension SuperResolutionTypeExt on SuperResolutionType {
|
||||
String get title => const ['禁用', '效率', '画质'][index];
|
||||
final String title;
|
||||
const SuperResolutionType(this.title);
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
//https://github.com/yujincheng08/BiliRoaming/blob/master/app/src/main/res/values/strings_raw.xml
|
||||
//https://github.com/yujincheng08/BiliRoaming/blob/master/app/src/main/res/values/arrays.xml
|
||||
|
||||
enum CDNService {
|
||||
baseUrl,
|
||||
backupUrl,
|
||||
ali,
|
||||
alib,
|
||||
alio1,
|
||||
cos,
|
||||
cosb,
|
||||
coso1,
|
||||
hw,
|
||||
hwb,
|
||||
hwo1,
|
||||
hw_08c,
|
||||
hw_08h,
|
||||
hw_08ct,
|
||||
tf_hw,
|
||||
tf_tx,
|
||||
akamai,
|
||||
aliov,
|
||||
cosov,
|
||||
hwov,
|
||||
hk_bcache,
|
||||
}
|
||||
|
||||
extension CDNServiceDesc on CDNService {
|
||||
static const List<String> _descList = [
|
||||
'基础 URL(不推荐)',
|
||||
'备用 URL',
|
||||
'ali(阿里云)',
|
||||
'alib(阿里云)',
|
||||
'alio1(阿里云)',
|
||||
'cos(腾讯云)',
|
||||
'cosb(腾讯云,VOD 加速类型)',
|
||||
'coso1(腾讯云)',
|
||||
'hw(华为云,融合 CDN)',
|
||||
'hwb(华为云,融合 CDN)',
|
||||
'hwo1(华为云,融合 CDN)',
|
||||
'08c(华为云,融合 CDN)',
|
||||
'08h(华为云,融合 CDN)',
|
||||
'08ct(华为云,融合 CDN)',
|
||||
'tf_hw(华为云)',
|
||||
'tf_tx(腾讯云)',
|
||||
'akamai(Akamai 海外)',
|
||||
'aliov(阿里云海外)',
|
||||
'cosov(腾讯云海外)',
|
||||
'hwov(华为云海外)',
|
||||
'hk_bcache(Bilibili海外)',
|
||||
];
|
||||
String get description => _descList[index];
|
||||
}
|
||||
|
||||
extension CDNServiceHost on CDNService {
|
||||
static const List<String> _hostList = [
|
||||
'',
|
||||
'',
|
||||
'upos-sz-mirrorali.bilivideo.com',
|
||||
'upos-sz-mirroralib.bilivideo.com',
|
||||
'upos-sz-mirroralio1.bilivideo.com',
|
||||
'upos-sz-mirrorcos.bilivideo.com',
|
||||
'upos-sz-mirrorcosb.bilivideo.com',
|
||||
'upos-sz-mirrorcoso1.bilivideo.com',
|
||||
'upos-sz-mirrorhw.bilivideo.com',
|
||||
'upos-sz-mirrorhwb.bilivideo.com',
|
||||
'upos-sz-mirrorhwo1.bilivideo.com',
|
||||
'upos-sz-mirror08c.bilivideo.com',
|
||||
'upos-sz-mirror08h.bilivideo.com',
|
||||
'upos-sz-mirror08ct.bilivideo.com',
|
||||
'upos-tf-all-hw.bilivideo.com',
|
||||
'upos-tf-all-tx.bilivideo.com',
|
||||
'upos-hz-mirrorakam.akamaized.net',
|
||||
'upos-sz-mirroraliov.bilivideo.com',
|
||||
'upos-sz-mirrorcosov.bilivideo.com',
|
||||
'upos-sz-mirrorhwov.bilivideo.com',
|
||||
'cn-hk-eq-bcache-01.bilivideo.com',
|
||||
];
|
||||
String get host => _hostList[index];
|
||||
}
|
||||
|
||||
extension CDNServiceCode on CDNService {
|
||||
static const List<String> _codeList = [
|
||||
'baseUrl',
|
||||
'backupUrl',
|
||||
'ali',
|
||||
'alib',
|
||||
'alio1',
|
||||
'cos',
|
||||
'cosb',
|
||||
'coso1',
|
||||
'hw',
|
||||
'hwb',
|
||||
'hwo1',
|
||||
'hw_08c',
|
||||
'hw_08h',
|
||||
'hw_08ct',
|
||||
'tf_hw',
|
||||
'tf_tx',
|
||||
'akamai',
|
||||
'aliov',
|
||||
'cosov',
|
||||
'hwov',
|
||||
'hk_bcache',
|
||||
];
|
||||
String get code => _codeList[index];
|
||||
|
||||
static CDNService? fromCode(String code) {
|
||||
final index = _codeList.indexOf(code);
|
||||
if (index != -1) {
|
||||
return CDNService.values[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
36
lib/models/common/video/cdn_type.dart
Normal file
36
lib/models/common/video/cdn_type.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
//https://github.com/yujincheng08/BiliRoaming/blob/master/app/src/main/res/values/strings_raw.xml
|
||||
//https://github.com/yujincheng08/BiliRoaming/blob/master/app/src/main/res/values/arrays.xml
|
||||
|
||||
enum CDNService {
|
||||
baseUrl('基础URL(不推荐)'),
|
||||
backupUrl('备用URL'),
|
||||
ali('ali(阿里云)', 'upos-sz-mirrorali.bilivideo.com'),
|
||||
alib('alib(阿里云)', 'upos-sz-mirroralib.bilivideo.com'),
|
||||
alio1('alio1(阿里云)', 'upos-sz-mirroralio1.bilivideo.com'),
|
||||
cos('cos(腾讯云)', 'upos-sz-mirrorcos.bilivideo.com'),
|
||||
cosb('cosb(腾讯云,VOD加速类型)', 'upos-sz-mirrorcosb.bilivideo.com'),
|
||||
coso1('coso1(腾讯云)', 'upos-sz-mirrorcoso1.bilivideo.com'),
|
||||
hw('hw(华为云,融合CDN)', 'upos-sz-mirrorhw.bilivideo.com'),
|
||||
hwb('hwb(华为云,融合CDN)', 'upos-sz-mirrorhwb.bilivideo.com'),
|
||||
hwo1('hwo1(华为云,融合CDN)', 'upos-sz-mirrorhwo1.bilivideo.com'),
|
||||
hw_08c('08c(华为云,融合CDN)', 'upos-sz-mirror08c.bilivideo.com'),
|
||||
hw_08h('08h(华为云,融合CDN)', 'upos-sz-mirror08h.bilivideo.com'),
|
||||
hw_08ct('08ct(华为云,融合CDN)', 'upos-sz-mirror08ct.bilivideo.com'),
|
||||
tf_hw('tf_hw(华为云)', 'upos-tf-all-hw.bilivideo.com'),
|
||||
tf_tx('tf_tx(腾讯云)', 'upos-tf-all-tx.bilivideo.com'),
|
||||
akamai('akamai(Akamai海外)', 'upos-hz-mirrorakam.akamaized.net'),
|
||||
aliov('aliov(阿里云海外)', 'upos-sz-mirroraliov.bilivideo.com'),
|
||||
cosov('cosov(腾讯云海外)', 'upos-sz-mirrorcosov.bilivideo.com'),
|
||||
hwov('hwov(华为云海外)', 'upos-sz-mirrorhwov.bilivideo.com'),
|
||||
hk_bcache('hk_bcache(Bilibili海外)', 'cn-hk-eq-bcache-01.bilivideo.com');
|
||||
|
||||
String get code => name;
|
||||
static final fromCode = values.byName;
|
||||
|
||||
final String description;
|
||||
final String host;
|
||||
|
||||
const CDNService(this.description, [this.host = '']);
|
||||
}
|
||||
@@ -1,19 +1,11 @@
|
||||
enum WebviewMenuItem {
|
||||
refresh,
|
||||
copy,
|
||||
openInBrowser,
|
||||
clearCache,
|
||||
resetCookie,
|
||||
goBack,
|
||||
}
|
||||
refresh('刷新'),
|
||||
copy('复制链接'),
|
||||
openInBrowser('浏览器中打开'),
|
||||
clearCache('清除缓存'),
|
||||
resetCookie('重新设置Cookie'),
|
||||
goBack('返回');
|
||||
|
||||
extension WebviewMenuItemExt on WebviewMenuItem {
|
||||
String get title => const [
|
||||
'刷新',
|
||||
'复制链接',
|
||||
'浏览器中打开',
|
||||
'清除缓存',
|
||||
'重新设置Cookie',
|
||||
'返回',
|
||||
][index];
|
||||
final String title;
|
||||
const WebviewMenuItem(this.title);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user