B面1.1.2 添加用户手动清除缓存选项

This commit is contained in:
Mr.zhou 2024-07-19 17:42:27 +08:00
parent 4e0c94f291
commit 6381a24bf9
12 changed files with 45 additions and 21 deletions

View File

@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Frame_34543@2x.png", "filename" : "img_v3_02cu_f53bc5b8-c70c-4922-a61f-60dfcff9008g.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Frame_34543@3x.png", "filename" : "img_v3_02cu_840d98d2-1a22-4b2e-adf3-d3557c9aad4g.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -369,6 +369,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
case .ICE: case .ICE:
guard level <= (OpenICEID.count-1) else { guard level <= (OpenICEID.count-1) else {
print("冷启动广告组已经全部加载失败,停止继续加载") print("冷启动广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.cold_ads_showFailureAction("No Ads Fill")
completion(false) completion(false)
return return
} }
@ -376,6 +377,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
case .HOST: case .HOST:
guard level <= (OpenHOSTID.count-1) else { guard level <= (OpenHOSTID.count-1) else {
print("热启动广告组已经全部加载失败,停止继续加载") print("热启动广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.hot_ads_showFailureAction("No Ads Fill")
completion(false) completion(false)
return return
} }
@ -617,6 +619,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
guard openAdStatus else {return} guard openAdStatus else {return}
guard level <= (SearchINSERTID.count-1) else { guard level <= (SearchINSERTID.count-1) else {
print("搜索插页广告组已经全部加载失败,停止继续加载") print("搜索插页广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.search_ads_showFailureAction("No Ads Fill")
// //
loadGlobalInterstitialAd { status in loadGlobalInterstitialAd { status in
completion(status) completion(status)
@ -722,6 +725,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
guard openAdStatus else {return} guard openAdStatus else {return}
guard level <= (PlayerINSERTID.count-1) else { guard level <= (PlayerINSERTID.count-1) else {
print("播放插页广告组已经全部加载失败,停止继续加载") print("播放插页广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.play_ads_showFailureAction("No Ads Fill")
// //
loadGlobalInterstitialAd { status in loadGlobalInterstitialAd { status in
completion(status) completion(status)
@ -828,6 +832,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
guard openAdStatus else {return} guard openAdStatus else {return}
guard level <= (SwitchINSERTID.count-1) else { guard level <= (SwitchINSERTID.count-1) else {
print("切歌插页广告组已经全部加载失败,停止继续加载") print("切歌插页广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.cut_ads_showFailureAction("No Ads Fill")
// //
loadGlobalInterstitialAd { status in loadGlobalInterstitialAd { status in
completion(status) completion(status)
@ -933,6 +938,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
guard openAdStatus else {return} guard openAdStatus else {return}
guard level <= (LoadINSERTID.count-1) else { guard level <= (LoadINSERTID.count-1) else {
print("下载插页广告组已经全部加载失败,停止继续加载") print("下载插页广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.dl_ads_showFailureAction("No Ads Fill")
// //
loadGlobalInterstitialAd { status in loadGlobalInterstitialAd { status in
completion(status) completion(status)
@ -1163,6 +1169,7 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont
guard openAdStatus else {return} guard openAdStatus else {return}
guard level <= (LibraryINSERTID.count-1) else { guard level <= (LibraryINSERTID.count-1) else {
print("曲库插页广告组已经全部加载失败,停止继续加载") print("曲库插页广告组已经全部加载失败,停止继续加载")
MP_AnalyticsManager.shared.listclk_ads_showFailureAction("No Ads Fill")
// //
loadGlobalInterstitialAd { status in loadGlobalInterstitialAd { status in
completion(status) completion(status)

View File

@ -112,10 +112,12 @@ class MP_HUD: NSObject {
}else { }else {
switch status { switch status {
case .success: case .success:
SVProgressHUD.setBackgroundColor(.init(hex: "#80F988", alpha: 0.1))
SVProgressHUD.showSuccess(withStatus: text) SVProgressHUD.showSuccess(withStatus: text)
SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 80 * width)) SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 80 * width))
SVProgressHUD.show(UIImage(), status: text) SVProgressHUD.show(UIImage(), status: text)
case .error: case .error:
SVProgressHUD.setBackgroundColor(.init(hex: "#80F988", alpha: 0.1))
SVProgressHUD.showError(withStatus: text) SVProgressHUD.showError(withStatus: text)
case .onlyText: case .onlyText:
SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 40 * width)) SVProgressHUD.setMinimumSize(CGSize(width: 100 * width, height: 40 * width))

View File

@ -25,8 +25,8 @@ class MP_NetWorkManager: NSObject {
private lazy var MPSession:Session = { private lazy var MPSession:Session = {
let configuration = URLSessionConfiguration.af.default let configuration = URLSessionConfiguration.af.default
//4 //4
configuration.timeoutIntervalForRequest = 30 configuration.timeoutIntervalForRequest = 20
configuration.timeoutIntervalForResource = 30 configuration.timeoutIntervalForResource = 20
return Alamofire.Session(configuration: configuration, interceptor: MP_CustomRetrier()) return Alamofire.Session(configuration: configuration, interceptor: MP_CustomRetrier())
}() }()
/// ///
@ -68,11 +68,11 @@ class MP_NetWorkManager: NSObject {
private var playerVersion:String! private var playerVersion:String!
///IP ///IP
private let banIPs:[String] = [ private let banIPs:[String] = [
// "CN", "CN",
// "HK", "HK",
// "TW", "TW",
// "JP", "JP",
// "KR" "KR"
] ]
///访Code ///访Code
private let codes:[String] = [ private let codes:[String] = [
@ -1235,6 +1235,11 @@ extension MP_NetWorkManager {
} }
// //
private func requestPostSearchPreviewResults(_ url:URL, parameters:Parameters, completion:@escaping (([MPPositive_SearchResultListViewModel]) -> Void)) { private func requestPostSearchPreviewResults(_ url:URL, parameters:Parameters, completion:@escaping (([MPPositive_SearchResultListViewModel]) -> Void)) {
guard netWorkStatu != .notReachable else {
completion([])
handleError(url, error: nil)
return
}
//post //post
MPSession.request(url, method: .post, parameters: parameters, encoding: JSONEncoding.default).responseDecodable(of: JsonSearchPreviewResults.self) { [weak self] (response) in MPSession.request(url, method: .post, parameters: parameters, encoding: JSONEncoding.default).responseDecodable(of: JsonSearchPreviewResults.self) { [weak self] (response) in
guard let self = self else {return} guard let self = self else {return}

View File

@ -438,9 +438,9 @@ class MP_PlayerManager:NSObject{
@objc private func netWorkReachableAction(_ sender:Notification) { @objc private func netWorkReachableAction(_ sender:Notification) {
// //
if loadPlayer?.currentVideo != nil { if loadPlayer?.currentVideo != nil {
if playState == .Playing { if playState == .Playing, let currentItem = loadPlayer?.currentVideo?.resourcePlayerItem {
// //
let currentTime = loadPlayer?.currentVideo?.resourcePlayerItem?.currentTime() ?? .zero let currentTime = currentItem.currentTime()
// //
player.seek(to: currentTime) player.seek(to: currentTime)
player.play() player.play()
@ -666,7 +666,7 @@ class MP_PlayerManager:NSObject{
} }
} }
default: default:
guard let songVideos = loadPlayer.songVideos, songVideos.count != 1 else { guard let songVideos = loadPlayer?.songVideos, songVideos.count != 1 else {
player.seek(to: .zero) player.seek(to: .zero)
playState = .Playing playState = .Playing
player.play() player.play()

View File

@ -126,7 +126,7 @@ extension MPPositive_OfflineSongsViewController: UITableViewDataSource, UITableV
MP_DownloadManager.shared.deleteFileDocuments(videoId) { videoId in MP_DownloadManager.shared.deleteFileDocuments(videoId) { videoId in
MP_HUD.progress("Loading...", delay: 0.5) { MP_HUD.progress("Loading...", delay: 0.5) {
MP_HUD.text("Removed", delay: 1.0, completion: nil) MP_HUD.text("Removed", delay: 1.0, completion: nil)
tableView.reloadData() self.reload()
} }
} }
} }
@ -145,7 +145,7 @@ extension MPPositive_OfflineSongsViewController: UITableViewDataSource, UITableV
// //
MP_DownloadManager.shared.cancelDownloadTask(videoId) { videoId in MP_DownloadManager.shared.cancelDownloadTask(videoId) { videoId in
MP_HUD.text("Canceled", delay: 1.0, completion: nil) MP_HUD.text("Canceled", delay: 1.0, completion: nil)
tableView.reloadData() self.reload()
} }
} }
alertController.addAction(sure) alertController.addAction(sure)

View File

@ -68,9 +68,10 @@ class MPPositive_SearchViewController: MPPositive_BaseViewController {
[weak self] in [weak self] in
guard let self = self else {return} guard let self = self else {return}
historyCollectionView.reloadData() historyCollectionView.reloadData()
historyCollectionView.layoutIfNeeded()
guard let layout = historyCollectionView.collectionViewLayout as? MPPositive_TagFlowLayout, let height = layout.layoutAttributeds.last?.frame.maxY else {return} guard let layout = historyCollectionView.collectionViewLayout as? MPPositive_TagFlowLayout, let height = layout.layoutAttributeds.last?.frame.maxY else {return}
historyCollectionView.snp.updateConstraints { make in historyCollectionView.snp.updateConstraints { make in
make.height.equalTo(height) make.height.equalTo(height*width)
} }
} }
grideCollectionView.reloadData() grideCollectionView.reloadData()
@ -82,6 +83,7 @@ class MPPositive_SearchViewController: MPPositive_BaseViewController {
deinit{ deinit{
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
// //
private func configure() { private func configure() {
let searchView = createSearchView() let searchView = createSearchView()
@ -163,17 +165,21 @@ class MPPositive_SearchViewController: MPPositive_BaseViewController {
MPPositive_SearchTagModel.fetchAll { [weak self] items in MPPositive_SearchTagModel.fetchAll { [weak self] items in
guard let self = self else {return} guard let self = self else {return}
items.forEach({(MPPositive_SearchTagModel.delete($0))}) items.forEach({(MPPositive_SearchTagModel.delete($0))})
guard let layout = historyCollectionView.collectionViewLayout as? MPPositive_TagFlowLayout else {return} guard let layout = historyCollectionView.collectionViewLayout as? MPPositive_TagFlowLayout else {return}
layout.originxArray.removeAll() layout.originxArray.removeAll()
layout.originyArray.removeAll() layout.originyArray.removeAll()
layout.layoutAttributeds.removeAll() layout.layoutAttributeds.removeAll()
historyCollectionView.reloadData() MPPositive_LoadCoreModel.shared.reloadSearchTags {
historyCollectionView.snp.updateConstraints { make in [weak self] in
self?.historyCollectionView.reloadData()
self?.historyCollectionView.snp.updateConstraints { make in
make.height.equalTo(10) make.height.equalTo(10)
} }
} }
} }
} }
}
//MARK: - collectionView //MARK: - collectionView
extension MPPositive_SearchViewController: UICollectionViewDataSource, UICollectionViewDelegate, MPPositive_TagLayoutDelegate { extension MPPositive_SearchViewController: UICollectionViewDataSource, UICollectionViewDelegate, MPPositive_TagLayoutDelegate {

View File

@ -52,9 +52,13 @@ extension MPPositive_SearchSuggestionsView:UITableViewDataSource, UITableViewDel
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
MPPositive_Debouncer.shared.call {
[weak self] in
guard let self = self else {return}
if selectedTextBlock != nil { if selectedTextBlock != nil {
let text = suggestions[indexPath.row].string let text = suggestions[indexPath.row].string
selectedTextBlock!(text) selectedTextBlock!(text)
} }
} }
} }
}