diff --git a/BilibiliLive/Module/ViewController/FavoriteViewController.swift b/BilibiliLive/Module/ViewController/FavoriteViewController.swift index f03ba690..acdf8715 100644 --- a/BilibiliLive/Module/ViewController/FavoriteViewController.swift +++ b/BilibiliLive/Module/ViewController/FavoriteViewController.swift @@ -17,18 +17,20 @@ class FavoriteViewController: CategoryViewController { Task { // 用户创建的收藏夹 let favList = try? await WebRequest.requestFavVideosList() - if favList != nil { - categories = favList!.map { + if let favList { + categories = favList.map { return CategoryDisplayModel(title: $0.title, contentVC: FavoriteVideoContentViewController(info: $0)) } } // 用户收藏的订阅 let favFolderCollectedList = try? await WebRequest.requestFavFolderCollectedList() - if favFolderCollectedList != nil { - favFolderCollectedList!.forEach { - categories.append(CategoryDisplayModel(title: $0.title, contentVC: FavoriteVideoContentViewController(info: $0))) - } + if let favFolderCollectedList { + favFolderCollectedList + .filter { $0.mid != 0 } + .forEach { + categories.append(CategoryDisplayModel(title: $0.title, contentVC: FavoriteVideoContentViewController(info: $0))) + } } initTypeCollectionView() diff --git a/BilibiliLive/Request/WebRequest.swift b/BilibiliLive/Request/WebRequest.swift index 0237739a..64156988 100644 --- a/BilibiliLive/Request/WebRequest.swift +++ b/BilibiliLive/Request/WebRequest.swift @@ -553,13 +553,14 @@ struct FavData: PlayableData, Codable { class FavListData: Codable, Hashable { let title: String let id: Int + var mid: Int? var currentPage = 1 var end = false var loading = false // 收藏夹是否为用户自己创建 var createBySelf = false enum CodingKeys: String, CodingKey { - case title, id + case title, id, mid } static func == (lhs: FavListData, rhs: FavListData) -> Bool {