Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/10-project/bilibili-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ WBI 相关真源:

- 需要登录
- 收藏夹 API 返回分页数据
- 导入对话框支持标签切换:"我的收藏夹"(调用 `/x/v3/fav/folder/created/list-all`)和"收藏的收藏夹"(调用 `/x/v3/fav/folder/collected/list`)
- 收藏的他人收藏夹会展示 UP 主名称
- 实际导入按 `bvid + cid` 去重
- 多 P 视频并不是天然完整导入,必须结合具体 `cid`
- 导入时会复用本地已有歌曲,不会盲目重复建 Song
Expand Down
34 changes: 24 additions & 10 deletions lib/core/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ class AppTheme {
AppThemePalette palette,
) {
final isWindows = defaultTargetPlatform == TargetPlatform.windows;
final isLinux = defaultTargetPlatform == TargetPlatform.linux;
final bodyWeight = isWindows ? FontWeight.w400 : FontWeight.w500;

TextStyle tune(
Expand All @@ -640,18 +641,31 @@ class AppTheme {
color: color ?? palette.textPrimary,
);

if (!isWindows) {
return tuned;
if (isWindows) {
return tuned.copyWith(
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: const [
'Microsoft YaHei',
'Segoe UI',
'Arial',
],
);
}

return tuned.copyWith(
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: const [
'Microsoft YaHei',
'Segoe UI',
'Arial',
],
);
if (isLinux) {
return tuned.copyWith(
fontFamilyFallback: const [
'Noto Sans CJK SC',
'Noto Sans SC',
'WenQuanYi Micro Hei',
'Source Han Sans SC',
'Noto Sans',
'sans-serif',
],
);
}

return tuned;
}

return base.copyWith(
Expand Down
22 changes: 18 additions & 4 deletions lib/features/playlist/application/bili_fav_import_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class BiliFavImportState with _$BiliFavImportState {

/// 已加载收藏夹列表,等待用户选择
const factory BiliFavImportState.foldersLoaded(
List<BiliFavFolder> folders,
List<BiliFavFolder> createdFolders,
List<BiliFavFolder> collectedFolders,
) = _FoldersLoaded;

/// 正在拉取收藏夹内容
Expand Down Expand Up @@ -81,7 +82,7 @@ class BiliFavImportNotifier extends _$BiliFavImportNotifier {
return const BiliFavImportState.idle();
}

/// 加载用户的 B 站收藏夹列表
/// 加载用户的 B 站收藏夹列表(包含自己创建的和收藏的他人收藏夹)
Future<void> loadFolders() async {
ref.keepAlive();
state = const BiliFavImportState.loadingFolders();
Expand All @@ -96,8 +97,21 @@ class BiliFavImportNotifier extends _$BiliFavImportNotifier {
state = const BiliFavImportState.error('pleaseLoginFirst');
return;
}
final folders = await _parseRepo.getFavoriteFolders(mid);
state = BiliFavImportState.foldersLoaded(folders);

// 并发加载创建的和收藏的收藏夹
final createdFolders = await _parseRepo.getFavoriteFolders(mid);
final collectedFolders =
await _parseRepo.getCollectedFavoriteFolders(mid);

AppLogger.info(
'收藏夹加载完成: 创建=${createdFolders.length}, 收藏=${collectedFolders.length}',
tag: 'BiliFavImport',
);

state = BiliFavImportState.foldersLoaded(
createdFolders,
collectedFolders,
);
} catch (e) {
AppLogger.error('加载收藏夹列表失败', tag: 'BiliFavImport', error: e);
state = BiliFavImportState.error(e.toString());
Expand Down
Loading
Loading