diff --git a/relax.offline.mp3.music.xcodeproj/project.pbxproj b/relax.offline.mp3.music.xcodeproj/project.pbxproj index 221c25e..7bf51b5 100644 --- a/relax.offline.mp3.music.xcodeproj/project.pbxproj +++ b/relax.offline.mp3.music.xcodeproj/project.pbxproj @@ -1927,7 +1927,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1.2.3.1; + CURRENT_PROJECT_VERSION = 1.2.4.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RAQJ4FNZUH; @@ -1948,7 +1948,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.3; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = relax.offline.mp3.music; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1973,7 +1973,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1.2.3.1; + CURRENT_PROJECT_VERSION = 1.2.4.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RAQJ4FNZUH; @@ -1994,7 +1994,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.3; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = relax.offline.mp3.music; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate index 82c8a4f..63dec7e 100644 Binary files a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate and b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift index e0690fc..5fee646 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift @@ -27,14 +27,16 @@ class MPPositive_Debouncer: NSObject { timer?.invalidate() timer = nil // 设置新的延迟调用 - timer = Timer.scheduledTimer(withTimeInterval: delay, repeats: false) { _ in + timer = Timer.scheduledTimer(withTimeInterval: delay, repeats: false) {[weak self] _ in + guard let _ = self else { return } action() } } func playCall(_ action:@escaping (() -> Void)) { playerTimer?.invalidate() playerTimer = nil - playerTimer = Timer.scheduledTimer(withTimeInterval: 10, repeats: false) { _ in + playerTimer = Timer.scheduledTimer(withTimeInterval: 10, repeats: false) {[weak self] _ in + guard let _ = self else { return } action() } } diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AdMobManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AdMobManager.swift index 8644aca..cd377d2 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AdMobManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AdMobManager.swift @@ -1725,7 +1725,9 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont completeGlobalInterstitialAdBlock!() } } - + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } //覆盖型广告加载出错 func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) { @@ -1781,7 +1783,9 @@ class MP_AdMobManager: NSObject, GADAudioVideoManagerDelegate, GADFullScreenCont completeGlobalInterstitialAdBlock!() } } - + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } //MARK: - GADNativeAdLoaderDelegate // 原生广告已加载,可以展示。 diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift index 901e3a9..8d4cdf5 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift @@ -426,7 +426,6 @@ class MP_AnalyticsManager: NSObject { } ///IP被拉黑 func resource_IP_blackAction() { - var parameters:[String:String] = [:] if let ipInfo = UserDefaults.standard.object(forKey: "IP_Info") as? String { parameters["ip"] = ipInfo diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AppLovinManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AppLovinManager.swift index 33b7d66..00b94da 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AppLovinManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AppLovinManager.swift @@ -829,6 +829,9 @@ extension MP_AppLovinManager: MAAdDelegate { block() } } + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } //广告点击 func didClick(_ ad: MAAd) { diff --git a/relax.offline.mp3.music/MP/MPPositive/Models/Models/MPPositive_CustomPlayListModel.swift b/relax.offline.mp3.music/MP/MPPositive/Models/Models/MPPositive_CustomPlayListModel.swift index a6cda8a..eea757a 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Models/Models/MPPositive_CustomPlayListModel.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Models/Models/MPPositive_CustomPlayListModel.swift @@ -27,7 +27,11 @@ class MPPositive_CustomPlayListModel: NSManagedObject, MP_CoreDataManageableDele extension MPPositive_CustomPlayListModel { ///将videos转为[MPPositive_CustomVideoModel] var videosArray:[MPPositive_CustomVideoModel]{ - let set = videos as? Set ?? [] + // 明确告诉 Core Data 将要访问属性 + self.willAccessValue(forKey: "videos") + let set = (videos as? Set)?.compactMap { $0 } ?? [] + // 告诉 Core Data 已经访问完属性 + self.didAccessValue(forKey: "videos") //转化成数组模型并进行排序(根据添加时间决定顺序) let array = Array(set).sorted { item1, item2 in diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_MoreSongOperationsViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_MoreSongOperationsViewController.swift index 7d2f3da..0c9e5e7 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_MoreSongOperationsViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_MoreSongOperationsViewController.swift @@ -102,7 +102,7 @@ class MPPositive_MoreSongOperationsViewController: UIViewController, UIViewContr // MP_HUD.loading() //发起网络请求补全数据 MP_NetWorkManager.shared.requestNextList(browseViewModel.browseItem.playListId ?? "", videoId: browseViewModel.browseItem.videoId ?? "", clickTrackingParams: browseViewModel.browseItem.clickTrackingParams) { [weak self] listSongs in - guard let first = listSongs.first else {return} + guard let first = listSongs.first(where: {$0.videoId == (browseViewModel.browseItem.videoId ?? "")}) else {return} let group = DispatchGroup() group.enter() improveDataforLycirsAndRelated(first) {[weak self] (result) in @@ -142,7 +142,7 @@ class MPPositive_MoreSongOperationsViewController: UIViewController, UIViewContr // MP_HUD.loading() //发起网络请求补全数据 MP_NetWorkManager.shared.requestNextList(searchResultItemViewModel.item.playListId ?? "", videoId: searchResultItemViewModel.item.videoId ?? "", clickTrackingParams: searchResultItemViewModel.item.clickTrackingParams) { [weak self] listSongs in - guard let first = listSongs.first else {return} + guard let first = listSongs.first(where: {$0.videoId == searchResultItemViewModel.item.videoId}) else {return} let group = DispatchGroup() group.enter() improveDataforLycirsAndRelated(first) {[weak self] (result) in @@ -182,7 +182,7 @@ class MPPositive_MoreSongOperationsViewController: UIViewController, UIViewContr // MP_HUD.loading() //发起网络请求补全数据 MP_NetWorkManager.shared.requestNextList("", videoId: collectionSongViewModel.collectionSong.videoId ?? "", clickTrackingParams: nil){ [weak self] listSongs in - guard let first = listSongs.first else {return} + guard let first = listSongs.first(where: {$0.videoId == collectionSongViewModel.collectionSong.videoId}) else {return} let group = DispatchGroup() group.enter() improveDataforLycirsAndRelated(first) {[weak self] (result) in @@ -223,7 +223,7 @@ class MPPositive_MoreSongOperationsViewController: UIViewController, UIViewContr // MP_HUD.loading() //发起网络请求补全数据 MP_NetWorkManager.shared.requestNextList("", videoId: video?.videoId ?? "", clickTrackingParams: nil){ [weak self] listSongs in - guard let first = listSongs.first else {return} + guard let first = listSongs.first(where: {$0.videoId == video?.videoId}) else {return} let group = DispatchGroup() group.enter() improveDataforLycirsAndRelated(first) {[weak self] (result) in diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift index 85f3192..d224ebe 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift @@ -244,7 +244,9 @@ extension MPPositive_TabBarController { block() } } - + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } //覆盖型广告加载出错 func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) { @@ -259,7 +261,9 @@ extension MPPositive_TabBarController { MP_AdMobManager.shared.completePlayInterstitialAdBlock!() } } - + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } //MARK: - AppLovin func didLoad(_ ad: MAAd) { @@ -289,6 +293,9 @@ extension MPPositive_TabBarController { block() } } + DispatchQueue.main.asyncAfter(deadline: .now()+0.1) { + accessAppdelegate.setAudioActive() + } } func didClick(_ ad: MAAd) {