feat: audio page (#1518)

* feat: audio page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* opt ui

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* impl intro, share, fav

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* tweaks

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

* load prev/next

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

---------

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
dom
2025-10-11 22:16:16 +08:00
committed by GitHub
parent a65edab7d1
commit 16f577f3fd
62 changed files with 49877 additions and 774 deletions

View File

@@ -1,9 +1,12 @@
import 'dart:async';
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
import 'package:PiliPlus/grpc/bilibili/app/listener/v1.pbenum.dart'
show PlaylistSource;
import 'package:PiliPlus/http/search.dart';
import 'package:PiliPlus/models/common/fav_type.dart';
import 'package:PiliPlus/models/common/video/source_type.dart';
import 'package:PiliPlus/pages/audio/view.dart';
import 'package:PiliPlus/pages/live/view.dart';
import 'package:PiliPlus/pages/rank/view.dart';
import 'package:PiliPlus/pages/subscription_detail/view.dart';
@@ -915,6 +918,19 @@ abstract class PiliScheme {
}
launchURL();
return false;
case 'audio':
// https://www.bilibili.com/audio/au123456
String? oid = RegExp(r'/au(\d+)').firstMatch(path)?.group(1);
if (oid != null) {
AudioPage.toAudioPage(
itemType: 3,
oid: int.parse(oid),
from: PlaylistSource.AUDIO_CARD,
);
return true;
}
launchURL();
return false;
default:
final res = IdUtils.matchAvorBv(input: area?.split('?').first);
if (res.isNotEmpty) {

View File

@@ -38,7 +38,7 @@ abstract class DateFormatUtils {
}
final DateFormat sdf = now.year == date.year
? short ?? shortFormat
: long ?? DateFormatUtils.longFormat;
: long ?? longFormat;
return sdf.format(date);
}

View File

@@ -67,6 +67,14 @@ extension NonNullListExt<T> on List<T> {
List<R> fromCast<R>() {
return List<R>.from(this);
}
T findClosestTarget(
bool Function(T) test,
T Function(T, T) combine,
) {
final filters = where(test).toList();
return filters.isNotEmpty ? filters.reduce(combine) : reduce(combine);
}
}
extension ListExt<T> on List<T>? {

View File

@@ -314,7 +314,7 @@ abstract class PageUtils {
static void showFavBottomSheet({
required BuildContext context,
required CommonIntroController ctr,
required FavMixin ctr,
}) {
showModalBottomSheet(
context: context,

View File

@@ -129,10 +129,11 @@ class ReplyUtils {
},
child: const Text('申诉'),
),
TextButton(
onPressed: Get.back,
child: const Text('关闭'),
),
if (!isManual)
TextButton(
onPressed: Get.back,
child: const Text('关闭'),
),
],
),
);

View File

@@ -342,10 +342,11 @@ abstract class RequestUtils {
},
child: const Text('申诉'),
),
TextButton(
onPressed: Get.back,
child: const Text('关闭'),
),
if (!isManual)
TextButton(
onPressed: Get.back,
child: const Text('关闭'),
),
],
),
);

View File

@@ -27,7 +27,8 @@ abstract class SettingBoxKey {
showSuperChat = 'showSuperChat',
keyboardControl = 'keyboardControl',
pauseOnMinimize = 'pauseOnMinimize',
pgcSkipType = 'pgcSkipType';
pgcSkipType = 'pgcSkipType',
audioPlayMode = 'audioPlayMode';
static const String enableVerticalExpand = 'enableVerticalExpand',
feedBackEnable = 'feedBackEnable',

View File

@@ -851,4 +851,8 @@ abstract class Pref {
static SkipType get pgcSkipType =>
SkipType.values[_setting.get(SettingBoxKey.pgcSkipType) ??
SkipType.skipOnce.index];
static PlayRepeat get audioPlayMode =>
PlayRepeat.values[_setting.get(SettingBoxKey.audioPlayMode) ??
PlayRepeat.listOrder.index];
}