* fix: 1080p

* opt: import export

* opt: downloader

* opt: skeleton

* opt: parseColor

* tweak

* opt: sb seek

* opt: rxn
This commit is contained in:
My-Responsitories
2026-05-08 12:50:43 +00:00
committed by dom
parent 07843a5e77
commit b7bd516aa7
28 changed files with 253 additions and 370 deletions

View File

@@ -103,16 +103,16 @@ class _DownloadDetailPageState extends State<DownloadDetailPage>
visualDensity: VisualDensity.compact,
),
onPressed: () async {
final allChecked = this.allChecked.toSet();
final futures = allChecked
.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
)
.toList();
handleSelect();
final res = await Future.wait(
allChecked.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
),
);
final res = await Future.wait(futures);
if (res.every((e) => e)) {
SmartDialog.showToast('更新成功');
} else {
@@ -201,22 +201,20 @@ class _DownloadDetailPageState extends State<DownloadDetailPage>
title: const Text('确定删除选中视频?'),
onConfirm: () async {
SmartDialog.showLoading();
final watchProgress = GStorage.watchProgress;
final allChecked = this.allChecked.toSet();
final allChecked = this.allChecked.toList();
final isDeleteAll = allChecked.length == _downloadItems.length;
if (isDeleteAll) {
await _closeSub();
}
for (final entry in allChecked) {
await watchProgress.deleteAll(
await Future.wait([
if (isDeleteAll) _closeSub(),
GStorage.watchProgress.deleteAll(
allChecked.map((e) => e.cid.toString()),
);
await _downloadService.deleteDownload(
entry: entry,
removeList: true,
refresh: false,
);
}
),
for (final entry in allChecked)
_downloadService.deleteDownload(
entry: entry,
removeList: true,
refresh: false,
),
]);
_downloadService.flagNotifier.refresh();
if (isDeleteAll) {
SmartDialog.dismiss();

View File

@@ -269,7 +269,10 @@ class DetailItem extends StatelessWidget {
type: PBadgeType.gray,
),
Positioned.fill(
child: selectMask(theme, checked ?? entry.checked),
child: selectMask(
theme.colorScheme,
checked ?? entry.checked,
),
),
],
),

View File

@@ -57,16 +57,16 @@ class _DownloadSearchPageState
TextButton(
style: TextButton.styleFrom(visualDensity: VisualDensity.compact),
onPressed: () async {
final allChecked = controller.allChecked.toSet();
final future = controller.allChecked
.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
)
.toList();
controller.handleSelect();
final res = await Future.wait(
allChecked.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
),
);
final res = await Future.wait(future);
if (res.every((e) => e)) {
SmartDialog.showToast('更新成功');
} else {

View File

@@ -11,13 +11,13 @@ import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
import 'package:PiliPlus/common/widgets/scaffold.dart';
import 'package:PiliPlus/common/widgets/select_mask.dart';
import 'package:PiliPlus/models/common/badge_type.dart';
import 'package:PiliPlus/models_new/download/bili_download_entry_info.dart';
import 'package:PiliPlus/models_new/download/download_info.dart';
import 'package:PiliPlus/pages/download/controller.dart';
import 'package:PiliPlus/pages/download/detail/view.dart';
import 'package:PiliPlus/pages/download/detail/widgets/item.dart';
import 'package:PiliPlus/pages/download/search/view.dart';
import 'package:PiliPlus/services/download/download_service.dart';
import 'package:PiliPlus/utils/cache_manager.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart' show IterableExt;
import 'package:PiliPlus/utils/grid.dart';
import 'package:PiliPlus/utils/platform_utils.dart';
@@ -67,20 +67,16 @@ class _DownloadPageState extends State<DownloadPage> {
visualDensity: VisualDensity.compact,
),
onPressed: () async {
final allChecked = _controller.allChecked.toSet();
final future = [
for (final page in _controller.allChecked)
for (final e in page.entries)
_downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
];
_controller.handleSelect();
final list = <BiliDownloadEntryInfo>[];
for (final page in allChecked) {
list.addAll(page.entries);
}
final res = await Future.wait(
list.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
),
);
final res = await Future.wait(future);
if (res.every((e) => e)) {
SmartDialog.showToast('更新成功');
} else {
@@ -355,7 +351,7 @@ class _DownloadPageState extends State<DownloadPage> {
top: 6.0,
),
Positioned.fill(
child: selectMask(theme, pageInfo.checked),
child: selectMask(theme.colorScheme, pageInfo.checked),
),
],
),
@@ -381,17 +377,14 @@ class _DownloadPageState extends State<DownloadPage> {
crossAxisAlignment: .end,
mainAxisAlignment: .spaceBetween,
children: [
if (first.ownerName case final ownerName?)
Text(
ownerName,
style: TextStyle(
fontSize: 12,
height: 1.6,
color: theme.colorScheme.outline,
),
)
else
const Spacer(),
Text(
'${CacheManager.formatSize(pageInfo.entries.fold(0, (p, n) => p + n.totalBytes))} ${first.ownerName ?? ""}',
style: TextStyle(
fontSize: 12,
height: 1.6,
color: theme.colorScheme.outline,
),
),
pageInfo.entries.first.moreBtn(theme),
],
),