mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-17 06:40:13 +08:00
committed by
GitHub
parent
1da30d5d8f
commit
a915650bb6
@@ -1,10 +1,9 @@
|
|||||||
enum AccountType {
|
enum AccountType {
|
||||||
main,
|
main('主账号'),
|
||||||
heartbeat,
|
heartbeat('记录观看'),
|
||||||
recommend,
|
recommend('推荐'),
|
||||||
video,
|
video('视频取流');
|
||||||
}
|
|
||||||
|
|
||||||
extension AccountTypeExt on AccountType {
|
final String title;
|
||||||
String get title => const ['主账号', '记录观看', '推荐', '视频取流'][index];
|
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 {
|
final String title;
|
||||||
String get title =>
|
final String param;
|
||||||
const ['禁用', '预设 dynaudnorm', '预设 loudnorm', '自定义参数'][index];
|
const AudioNormalization(this.title, [this.param = '']);
|
||||||
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];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
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 {
|
final String? desc;
|
||||||
String get desc => const ['', '大会员', '认证个人', '认证机构'][index];
|
final Color? color;
|
||||||
Color get color => const [
|
const BadgeType([this.desc, this.color]);
|
||||||
Colors.transparent,
|
|
||||||
Color(0xFFFF6699),
|
|
||||||
Color(0xFFFFCC00),
|
|
||||||
Colors.lightBlueAccent
|
|
||||||
][index];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
enum EpisodeType { part, season, bangumi }
|
enum EpisodeType {
|
||||||
|
part('分P'),
|
||||||
|
season('合集'),
|
||||||
|
bangumi('番剧');
|
||||||
|
|
||||||
extension EpisodeTypeExt on EpisodeType {
|
final String title;
|
||||||
String get title => const ['分P', '合集', '番剧'][index];
|
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:PiliPlus/pages/fav/video/view.dart';
|
||||||
import 'package:flutter/material.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 {
|
final String title;
|
||||||
String get title => const ['视频', '追番', '追剧', '专栏', '笔记'][index];
|
final Widget page;
|
||||||
|
const FavTabType(this.title, this.page);
|
||||||
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(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
enum FollowOrderType { def, attention }
|
enum FollowOrderType {
|
||||||
|
def('', '最近关注'),
|
||||||
|
attention('attention', '最常访问');
|
||||||
|
|
||||||
extension FollowOrderTypeExt on FollowOrderType {
|
final String type;
|
||||||
String get type => const ['', 'attention'][index];
|
final String title;
|
||||||
String get title => const ['最近关注', '最常访问'][index];
|
|
||||||
|
const FollowOrderType(this.type, this.title);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
enum HistoryBusinessType {
|
enum HistoryBusinessType {
|
||||||
// 普通视频
|
// 普通视频
|
||||||
archive,
|
archive('archive'),
|
||||||
// 剧集(番剧 / 影视)
|
// 剧集(番剧 / 影视)
|
||||||
pgc,
|
pgc('pgc'),
|
||||||
// 直播
|
// 直播
|
||||||
live,
|
live('live'),
|
||||||
// 文章
|
// 文章
|
||||||
articleList,
|
articleList('article-list'),
|
||||||
// 文章
|
// 文章
|
||||||
article,
|
article('article');
|
||||||
hiddenDurationType,
|
|
||||||
showBadge
|
|
||||||
}
|
|
||||||
|
|
||||||
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:get/get.dart';
|
||||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.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 {
|
final String description;
|
||||||
String get description => const ['直播', '推荐', '热门', '分区', '番剧', '影视'][index];
|
const HomeTabType(this.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
List get homeTabsConfig => [
|
List get homeTabsConfig => [
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import 'package:PiliPlus/pages/later/child_view.dart';
|
import 'package:PiliPlus/pages/later/child_view.dart';
|
||||||
import 'package:flutter/material.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;
|
int get type => index;
|
||||||
|
|
||||||
String get title => const ['全部', '未看', '未看完', '已看完'][index];
|
|
||||||
|
|
||||||
Widget get page => LaterViewChildPage(laterViewType: this);
|
Widget get page => LaterViewChildPage(laterViewType: this);
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
const LaterViewType(this.title);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,30 @@
|
|||||||
import 'package:flutter/material.dart';
|
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 = [
|
List defaultNavigationBars = [
|
||||||
{
|
{
|
||||||
'id': 0,
|
'id': 0,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// TODO named record or enum
|
||||||
const List rankTabsConfig = [
|
const List rankTabsConfig = [
|
||||||
{
|
{
|
||||||
'rid': 0,
|
'rid': 0,
|
||||||
|
|||||||
@@ -2,52 +2,41 @@
|
|||||||
enum SearchType {
|
enum SearchType {
|
||||||
// all,
|
// all,
|
||||||
// 视频:video
|
// 视频:video
|
||||||
video,
|
video('视频'),
|
||||||
// 番剧:media_bangumi,
|
// 番剧:media_bangumi,
|
||||||
media_bangumi,
|
media_bangumi('番剧'),
|
||||||
// 影视:media_ft
|
// 影视:media_ft
|
||||||
media_ft,
|
media_ft('影视'),
|
||||||
// 直播间及主播:live
|
// 直播间及主播:live
|
||||||
// live,
|
// live,
|
||||||
// 直播间:live_room
|
// 直播间:live_room
|
||||||
live_room,
|
live_room('直播间'),
|
||||||
// 主播:live_user
|
// 主播:live_user
|
||||||
// live_user,
|
// live_user,
|
||||||
// 话题:topic
|
// 话题:topic
|
||||||
// topic,
|
// topic,
|
||||||
// 用户:bili_user
|
// 用户:bili_user
|
||||||
bili_user,
|
bili_user('用户'),
|
||||||
// 专栏:article
|
// 专栏:article
|
||||||
article,
|
article('专栏');
|
||||||
// 相簿:photo
|
// 相簿:photo
|
||||||
// photo
|
// photo
|
||||||
}
|
|
||||||
|
|
||||||
extension SearchTypeExtension on SearchType {
|
final String label;
|
||||||
String get label => const [
|
const SearchType(this.label);
|
||||||
// '综合',
|
|
||||||
'视频',
|
|
||||||
'番剧',
|
|
||||||
'影视',
|
|
||||||
'直播间',
|
|
||||||
'用户',
|
|
||||||
'专栏',
|
|
||||||
][index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 搜索类型为视频、专栏及相簿时
|
// 搜索类型为视频、专栏及相簿时
|
||||||
enum ArchiveFilterType {
|
enum ArchiveFilterType {
|
||||||
totalrank,
|
totalrank('默认排序'),
|
||||||
click,
|
click('播放多'),
|
||||||
pubdate,
|
pubdate('新发布'),
|
||||||
dm,
|
dm('弹幕多'),
|
||||||
stow,
|
stow('收藏多'),
|
||||||
scores,
|
scores('评论多');
|
||||||
// 专栏
|
// 专栏
|
||||||
// attention,
|
// attention('最多喜欢'),
|
||||||
}
|
|
||||||
|
|
||||||
extension ArchiveFilterTypeExtension on ArchiveFilterType {
|
final String description;
|
||||||
String get description =>
|
const ArchiveFilterType(this.description);
|
||||||
const ['默认排序', '播放多', '新发布', '弹幕多', '收藏多', '评论多', '最多喜欢'][index];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
enum SuperResolutionType { disable, efficiency, quality }
|
enum SuperResolutionType {
|
||||||
|
disable('禁用'),
|
||||||
|
efficiency('效率'),
|
||||||
|
quality('画质');
|
||||||
|
|
||||||
extension SuperResolutionTypeExt on SuperResolutionType {
|
final String title;
|
||||||
String get title => const ['禁用', '效率', '画质'][index];
|
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 {
|
enum WebviewMenuItem {
|
||||||
refresh,
|
refresh('刷新'),
|
||||||
copy,
|
copy('复制链接'),
|
||||||
openInBrowser,
|
openInBrowser('浏览器中打开'),
|
||||||
clearCache,
|
clearCache('清除缓存'),
|
||||||
resetCookie,
|
resetCookie('重新设置Cookie'),
|
||||||
goBack,
|
goBack('返回');
|
||||||
}
|
|
||||||
|
|
||||||
extension WebviewMenuItemExt on WebviewMenuItem {
|
final String title;
|
||||||
String get title => const [
|
const WebviewMenuItem(this.title);
|
||||||
'刷新',
|
|
||||||
'复制链接',
|
|
||||||
'浏览器中打开',
|
|
||||||
'清除缓存',
|
|
||||||
'重新设置Cookie',
|
|
||||||
'返回',
|
|
||||||
][index];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,8 +145,7 @@ class HistoryItem extends StatelessWidget {
|
|||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
if (!HistoryBusinessType
|
if (!HistoryBusinessType.hiddenDurationType
|
||||||
.hiddenDurationType.hiddenDurationType
|
|
||||||
.contains(videoItem.history.business))
|
.contains(videoItem.history.business))
|
||||||
PBadge(
|
PBadge(
|
||||||
text: videoItem.progress == -1
|
text: videoItem.progress == -1
|
||||||
@@ -157,7 +156,7 @@ class HistoryItem extends StatelessWidget {
|
|||||||
type: 'gray',
|
type: 'gray',
|
||||||
),
|
),
|
||||||
// 右上角
|
// 右上角
|
||||||
if (HistoryBusinessType.showBadge.showBadge
|
if (HistoryBusinessType.showBadge
|
||||||
.contains(videoItem.history.business) ||
|
.contains(videoItem.history.business) ||
|
||||||
videoItem.history.business ==
|
videoItem.history.business ==
|
||||||
HistoryBusinessType.live.type)
|
HistoryBusinessType.live.type)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class MemberController extends CommonDataController<SpaceData, dynamic>
|
class MemberController extends CommonDataController<SpaceData, SpaceData?>
|
||||||
with GetTickerProviderStateMixin {
|
with GetTickerProviderStateMixin {
|
||||||
MemberController({required this.mid});
|
MemberController({required this.mid});
|
||||||
int mid;
|
int mid;
|
||||||
@@ -141,7 +141,7 @@ class MemberController extends CommonDataController<SpaceData, dynamic>
|
|||||||
);
|
);
|
||||||
showUname.value = true;
|
showUname.value = true;
|
||||||
username = errMsg;
|
username = errMsg;
|
||||||
loadingState.value = LoadingState.success(null);
|
loadingState.value = LoadingState<SpaceData?>.success(null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,20 +40,19 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
return _buildBody(_ctr.loadingState.value);
|
return _buildBody(_ctr.loadingState.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody(LoadingState loadingState) {
|
Widget _buildBody(LoadingState<SpaceData?> loadingState) {
|
||||||
final isVertical = context.orientation == Orientation.portrait;
|
final isVertical = context.orientation == Orientation.portrait;
|
||||||
return switch (loadingState) {
|
return switch (loadingState) {
|
||||||
Loading() => loadingWidget,
|
Loading() => loadingWidget,
|
||||||
Success() => loadingState.response is SpaceData
|
Success(response: final res) => res != null
|
||||||
? CustomScrollView(
|
? CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
if (loadingState.response?.archive?.item?.isNotEmpty ==
|
if (res.archive?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '视频',
|
title: '视频',
|
||||||
param: 'contribute',
|
param: 'contribute',
|
||||||
param1: 'video',
|
param1: 'video',
|
||||||
count: loadingState.response.archive.count,
|
count: res.archive!.count!,
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -71,38 +70,35 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
return VideoCardVMemberHome(
|
return VideoCardVMemberHome(
|
||||||
videoItem:
|
videoItem: res.archive!.item![index],
|
||||||
loadingState.response.archive.item[index],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: min(isVertical ? 4 : 8,
|
childCount:
|
||||||
loadingState.response.archive.item.length),
|
min(isVertical ? 4 : 8, res.archive!.item!.length),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (loadingState.response?.favourite2?.item?.isNotEmpty ==
|
if (res.favourite2?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '收藏',
|
title: '收藏',
|
||||||
param: 'favorite',
|
param: 'favorite',
|
||||||
count: loadingState.response.favourite2.count,
|
count: res.favourite2!.count!,
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 98,
|
height: 98,
|
||||||
child: MemberFavItem(
|
child: MemberFavItem(
|
||||||
item: loadingState.response.favourite2.item.first,
|
item: res.favourite2!.item!.first,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (loadingState.response?.coinArchive?.item?.isNotEmpty ==
|
if (res.coinArchive?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '最近投币的视频',
|
title: '最近投币的视频',
|
||||||
param: 'coinArchive',
|
param: 'coinArchive',
|
||||||
count: loadingState.response.coinArchive.count,
|
count: res.coinArchive!.count!,
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -120,22 +116,20 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
return VideoCardVMemberHome(
|
return VideoCardVMemberHome(
|
||||||
videoItem:
|
videoItem: res.coinArchive!.item![index],
|
||||||
loadingState.response.coinArchive.item[index],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: min(isVertical ? 2 : 4,
|
childCount: min(
|
||||||
loadingState.response.coinArchive.item.length),
|
isVertical ? 2 : 4, res.coinArchive!.item!.length),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (loadingState.response?.likeArchive?.item?.isNotEmpty ==
|
if (res.likeArchive?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '最近点赞的视频',
|
title: '最近点赞的视频',
|
||||||
param: 'likeArchive',
|
param: 'likeArchive',
|
||||||
count: loadingState.response.likeArchive.count,
|
count: res.likeArchive!.count!,
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -153,54 +147,48 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
return VideoCardVMemberHome(
|
return VideoCardVMemberHome(
|
||||||
videoItem:
|
videoItem: res.likeArchive!.item![index],
|
||||||
loadingState.response.likeArchive.item[index],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: min(isVertical ? 2 : 4,
|
childCount: min(
|
||||||
loadingState.response.likeArchive.item.length),
|
isVertical ? 2 : 4, res.likeArchive!.item!.length),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (loadingState.response?.article?.item?.isNotEmpty ==
|
if (res.article?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '专栏',
|
title: '专栏',
|
||||||
param: 'contribute',
|
param: 'contribute',
|
||||||
param1: 'article',
|
param1: 'article',
|
||||||
count: loadingState.response.article.count,
|
count: res.article!.count!,
|
||||||
),
|
),
|
||||||
SliverGrid(
|
SliverGrid(
|
||||||
gridDelegate: Grid.videoCardHDelegate(context),
|
gridDelegate: Grid.videoCardHDelegate(context),
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
return MemberArticleItem(
|
return MemberArticleItem(
|
||||||
item: loadingState.response.article.item[index],
|
item: res.article!.item![index],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: isVertical
|
childCount: isVertical ? 1 : res.article!.item!.length,
|
||||||
? 1
|
|
||||||
: loadingState.response.article.item.length,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (loadingState.response?.audios?.item?.isNotEmpty ==
|
if (res.audios?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '音频',
|
title: '音频',
|
||||||
param: 'contribute',
|
param: 'contribute',
|
||||||
param1: 'audio',
|
param1: 'audio',
|
||||||
count: loadingState.response.audios.count,
|
count: res.audios!.count!,
|
||||||
),
|
),
|
||||||
// TODO
|
// TODO
|
||||||
],
|
],
|
||||||
if (loadingState.response?.season?.item?.isNotEmpty ==
|
if (res.season?.item?.isNotEmpty == true) ...[
|
||||||
true) ...[
|
|
||||||
_videoHeader(
|
_videoHeader(
|
||||||
title: '追番',
|
title: '追番',
|
||||||
param: 'bangumi',
|
param: 'bangumi',
|
||||||
count: loadingState.response.season.count,
|
count: res.season!.count!,
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -218,12 +206,11 @@ class _MemberHomeState extends State<MemberHome>
|
|||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
return BangumiCardVMemberHome(
|
return BangumiCardVMemberHome(
|
||||||
bangumiItem:
|
bangumiItem: res.season!.item![index],
|
||||||
loadingState.response.season.item[index],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: min(isVertical ? 3 : 6,
|
childCount:
|
||||||
loadingState.response.season.item.length),
|
min(isVertical ? 3 : 6, res.season!.item!.length),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
|||||||
import 'package:PiliPlus/models/common/settings_type.dart';
|
import 'package:PiliPlus/models/common/settings_type.dart';
|
||||||
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
||||||
import 'package:PiliPlus/models/common/theme/theme_type.dart';
|
import 'package:PiliPlus/models/common/theme/theme_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/CDN.dart';
|
|
||||||
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
||||||
|
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
||||||
import 'package:PiliPlus/models/common/video/subtitle_pref_type.dart';
|
import 'package:PiliPlus/models/common/video/subtitle_pref_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
||||||
@@ -1029,7 +1029,7 @@ List<SettingsModel> get videoSettings => [
|
|||||||
title: 'CDN 设置',
|
title: 'CDN 设置',
|
||||||
leading: Icon(MdiIcons.cloudPlusOutline),
|
leading: Icon(MdiIcons.cloudPlusOutline),
|
||||||
getSubtitle: () =>
|
getSubtitle: () =>
|
||||||
'当前使用:${CDNServiceCode.fromCode(GStorage.defaultCDNService)!.description},部分 CDN 可能失效,如无法播放请尝试切换',
|
'当前使用:${CDNService.fromCode(GStorage.defaultCDNService).description},部分 CDN 可能失效,如无法播放请尝试切换',
|
||||||
onTap: (setState) async {
|
onTap: (setState) async {
|
||||||
String? result = await showDialog(
|
String? result = await showDialog(
|
||||||
context: Get.context!,
|
context: Get.context!,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/common/video/CDN.dart';
|
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||||
import 'package:PiliPlus/models/video/play/url.dart';
|
import 'package:PiliPlus/models/video/play/url.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/video_utils.dart';
|
import 'package:PiliPlus/utils/video_utils.dart';
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||||
import 'package:PiliPlus/models/common/search_type.dart';
|
import 'package:PiliPlus/models/common/search_type.dart';
|
||||||
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/CDN.dart';
|
|
||||||
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
||||||
|
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/video_quality.dart';
|
import 'package:PiliPlus/models/common/video/video_quality.dart';
|
||||||
import 'package:PiliPlus/models/video/play/url.dart';
|
import 'package:PiliPlus/models/video/play/url.dart';
|
||||||
@@ -253,7 +253,7 @@ class HeaderControlState extends State<HeaderControl> {
|
|||||||
title: const Text('CDN 设置', style: titleStyle),
|
title: const Text('CDN 设置', style: titleStyle),
|
||||||
leading: Icon(MdiIcons.cloudPlusOutline, size: 20),
|
leading: Icon(MdiIcons.cloudPlusOutline, size: 20),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'当前:${CDNServiceCode.fromCode(defaultCDNService)!.description},无法播放请切换',
|
'当前:${CDNService.fromCode(defaultCDNService).description},无法播放请切换',
|
||||||
style: subTitleStyle,
|
style: subTitleStyle,
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@@ -269,7 +269,7 @@ class HeaderControlState extends State<HeaderControl> {
|
|||||||
defaultCDNService = result;
|
defaultCDNService = result;
|
||||||
setting.put(SettingBoxKey.CDNService, result);
|
setting.put(SettingBoxKey.CDNService, result);
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast(
|
||||||
'已设置为 ${CDNServiceCode.fromCode(result)!.description},正在重载视频');
|
'已设置为 ${CDNService.fromCode(result).description},正在重载视频');
|
||||||
setState(() {});
|
setState(() {});
|
||||||
videoDetailCtr.queryVideoUrl(
|
videoDetailCtr.queryVideoUrl(
|
||||||
videoDetailCtr.playedTime,
|
videoDetailCtr.playedTime,
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import 'package:PiliPlus/models/common/msg/msg_unread_type.dart';
|
|||||||
import 'package:PiliPlus/models/common/sponsor_block/segment_type.dart';
|
import 'package:PiliPlus/models/common/sponsor_block/segment_type.dart';
|
||||||
import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
|
import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
|
||||||
import 'package:PiliPlus/models/common/theme/theme_type.dart';
|
import 'package:PiliPlus/models/common/theme/theme_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/CDN.dart';
|
|
||||||
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
import 'package:PiliPlus/models/common/video/audio_quality.dart';
|
||||||
|
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
||||||
import 'package:PiliPlus/models/common/video/subtitle_pref_type.dart';
|
import 'package:PiliPlus/models/common/video/subtitle_pref_type.dart';
|
||||||
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
import 'package:PiliPlus/models/common/video/video_decode_type.dart';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:PiliPlus/models/common/video/CDN.dart';
|
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_room/room_info.dart';
|
import 'package:PiliPlus/models/live/live_room/room_info.dart';
|
||||||
import 'package:PiliPlus/models/video/play/url.dart';
|
import 'package:PiliPlus/models/video/play/url.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
@@ -6,11 +6,10 @@ import 'package:PiliPlus/utils/storage.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class VideoUtils {
|
class VideoUtils {
|
||||||
static String getCdnUrl(dynamic item, [defaultCDNService]) {
|
static String getCdnUrl(dynamic item, [String? defaultCDNService]) {
|
||||||
String? backupUrl;
|
String? backupUrl;
|
||||||
String? videoUrl;
|
String? videoUrl;
|
||||||
defaultCDNService ??= GStorage.setting
|
defaultCDNService ??= GStorage.defaultCDNService;
|
||||||
.get(SettingBoxKey.CDNService, defaultValue: CDNService.backupUrl.code);
|
|
||||||
if (item is AudioItem) {
|
if (item is AudioItem) {
|
||||||
if (GStorage.setting
|
if (GStorage.setting
|
||||||
.get(SettingBoxKey.disableAudioCDN, defaultValue: true)) {
|
.get(SettingBoxKey.disableAudioCDN, defaultValue: true)) {
|
||||||
@@ -41,7 +40,7 @@ class VideoUtils {
|
|||||||
}
|
}
|
||||||
debugPrint("videoUrl:$videoUrl");
|
debugPrint("videoUrl:$videoUrl");
|
||||||
|
|
||||||
String defaultCDNHost = CDNServiceCode.fromCode(defaultCDNService)!.host;
|
String defaultCDNHost = CDNService.fromCode(defaultCDNService).host;
|
||||||
debugPrint("defaultCDNHost:$defaultCDNHost");
|
debugPrint("defaultCDNHost:$defaultCDNHost");
|
||||||
if (videoUrl!.contains("szbdyd.com")) {
|
if (videoUrl!.contains("szbdyd.com")) {
|
||||||
final uri = Uri.parse(videoUrl);
|
final uri = Uri.parse(videoUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user