100Years 3 долоо хоног өмнө
parent
commit
7c0d7e59ce
21 өөрчлөгдсөн 58 нэмэгдсэн , 28 устгасан
  1. 4 4
      AIEmoji.xcodeproj/project.pbxproj
  2. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_BlackWhiteAnime.imageset/ptp_style_BlackWhiteAnime@2x.png
  3. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_BlackWhiteAnime.imageset/ptp_style_BlackWhiteAnime@3x.png
  4. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_KnitDoll.imageset/ptp_style_KnitDoll@2x.png
  5. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_KnitDoll.imageset/ptp_style_KnitDoll@3x.png
  6. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_Monet.imageset/ptp_style_Monet@2x.png
  7. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_Monet.imageset/ptp_style_Monet@3x.png
  8. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_SingleFigurine.imageset/ptp_style_SingleFigurine@2x.png
  9. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_SingleFigurine.imageset/ptp_style_SingleFigurine@3x.png
  10. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_Toy.imageset/ptp_style_Toy@2x.png
  11. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_Toy.imageset/ptp_style_Toy@3x.png
  12. 1 0
      AIEmoji/Business/Data/TSDBHistoryManager.swift
  13. 19 9
      AIEmoji/Business/Data/TSUserDefaultData.swift
  14. 2 1
      AIEmoji/Business/TSAILIstVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift
  15. 11 0
      AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/Model/TSDBActionInfoModel.swift
  16. 1 1
      AIEmoji/Business2/DisCover/TSDiscoverVC/TSDiscoverVC.swift
  17. 2 2
      AIEmoji/Business2/DisCover/TSGenerateHistoryVC/TSGenerateHistoryVC.swift
  18. 8 1
      AIEmoji/Business2/DisCover/TSGenerateHistoryVC/View/TSGenerateHistoryCell.swift
  19. 6 6
      AIEmoji/Common/Purchase/TSPurchaseManager.swift
  20. 1 1
      AIEmoji/Common/TSRealmManager/TSRealmManager.swift
  21. 3 3
      AIEmoji/Common/Tool/OperationQueue/V2/TSGenerateBaseOperation.swift

+ 4 - 4
AIEmoji.xcodeproj/project.pbxproj

@@ -2824,7 +2824,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2840,7 +2840,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.20;
+				MARKETING_VERSION = 3.6.18;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -2863,7 +2863,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2879,7 +2879,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.20;
+				MARKETING_VERSION = 3.6.18;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_BlackWhiteAnime.imageset/ptp_style_BlackWhiteAnime@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_BlackWhiteAnime.imageset/ptp_style_BlackWhiteAnime@3x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_KnitDoll.imageset/ptp_style_KnitDoll@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_KnitDoll.imageset/ptp_style_KnitDoll@3x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_Monet.imageset/ptp_style_Monet@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_Monet.imageset/ptp_style_Monet@3x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_SingleFigurine.imageset/ptp_style_SingleFigurine@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_SingleFigurine.imageset/ptp_style_SingleFigurine@3x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_Toy.imageset/ptp_style_Toy@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_Toy.imageset/ptp_style_Toy@3x.png


+ 1 - 0
AIEmoji/Business/Data/TSDBHistoryManager.swift

@@ -252,6 +252,7 @@ extension TSRealmManager {
                                     "success","image_create", 1)
         let results = realm.objects(TSDBActionInfoModel.self)
             .filter(predicate)
+            .distinct(by: ["id"])  // 根据id去重
             .sorted(byKeyPath: "createdTimestamp", ascending: false)
 
         let combinedList = List<TSDBActionInfoModel>()

+ 19 - 9
AIEmoji/Business/Data/TSUserDefaultData.swift

@@ -7,15 +7,25 @@
 import ObjectMapper
 
 func kHandleDBHistoryOperation(){
-    let listModels = TSRMShared.ptpDBHistory.listModels
-    for model in listModels {
-        if model.modelType != 1 {
-            if model.isResult == false,model.id > 0 {
-                let generatePTPOperation = TSGeneratePTPOperationQueue.shared.creatOperation(uuid: model.uuid)
-                generatePTPOperation.isSaveProcessToDB = true
-                generatePTPOperation.getActionInfo(oldModel: model.getModel())
-            }
-        }
+//    let listModels = TSRMShared.ptpDBHistory.listModels
+//    for model in listModels {
+//        if model.modelType != 1 {
+//            if model.isResult == false,model.id > 0 {
+//                let generatePTPOperation = TSGeneratePTPOperationQueue.shared.creatOperation(uuid: model.uuid)
+//                generatePTPOperation.isSaveProcessToDB = true
+//                generatePTPOperation.getActionInfo(oldModel: model.getModel())
+//            }
+//        }
+//    }
+    
+    
+    let listModels = TSRMShared.aiGenerateDB.listModels
+    let filteredResults = listModels.filter("status == %@ AND id > 0", "running")//直接过滤List(返回Results类型)
+
+    for model in filteredResults {
+        let generatePTPOperation = TSGenerateBasePhotoOperationQueue.shared.creatOperation(uuid: model.uuid)
+        generatePTPOperation.isSaveProcessToDB = true
+        generatePTPOperation.getActionInfo(oldModel: model.getModel())
     }
 }
 

+ 2 - 1
AIEmoji/Business/TSAILIstVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift

@@ -94,7 +94,8 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     // MARK: - Setup
     private func setupUI() {
-        view.backgroundColor = "#111111".uiColor
+//        view.backgroundColor = "#111111".uiColor
+        view.backgroundColor = .clear
         playerContainerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(playPauseTapped)))
         view.addSubview(playerContainerView)
         playerContainerView.addSubview(playPauseButton)

+ 11 - 0
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/Model/TSDBActionInfoModel.swift

@@ -152,6 +152,10 @@ class TSDBActionRequestModel : Object {
     @Persisted var style:String = ""
     @Persisted var advance:Bool = false
     
+    
+    @Persisted var model:String = ""  //模型
+    @Persisted var generatorStyle:Int = 15
+    
     static func createDBModel(requestModel:TSActionRequestModel) -> TSDBActionRequestModel{
         let dbModel = TSDBActionRequestModel()
         dbModel.saveData(requestModel: requestModel)
@@ -168,6 +172,9 @@ class TSDBActionRequestModel : Object {
         self.imageUrlTimestamp = requestModel.imageUrlTimestamp
         self.style = requestModel.style
         self.advance = requestModel.advance
+
+        self.model = requestModel.model
+        self.generatorStyle = requestModel.generatorStyle.rawValue
         
         let list = List<String>()
         list.append(objectsIn: requestModel.imageUrls)
@@ -187,6 +194,10 @@ class TSDBActionRequestModel : Object {
         model.style = self.style
         model.advance = self.advance
         model.imageUrls = Array(self.imageUrls)
+        
+        model.model = self.model
+        model.generatorStyle = TSFuncStyle(rawValue: self.generatorStyle) ?? .ptp
+        
         return model
     }
 

+ 1 - 1
AIEmoji/Business2/DisCover/TSDiscoverVC/TSDiscoverVC.swift

@@ -22,7 +22,7 @@ class TSDiscoverVC: TSBaseVC {
     lazy var navBarView: TSBaseNavContentBarView = {
         let navBarView = TSBaseNavContentBarView()
 
-        let label = UILabel.createLabel(text: "Discover".localized,font: .font(name: .KelsiFill,size: 28))
+        let label = UILabel.createLabel(text: "Discover",font: .font(name: .KelsiFill,size: 28))
         navBarView.barView.addSubview(label)
         label.snp.makeConstraints { make in
             make.centerY.equalToSuperview()

+ 2 - 2
AIEmoji/Business2/DisCover/TSGenerateHistoryVC/TSGenerateHistoryVC.swift

@@ -22,7 +22,7 @@ class TSGenerateHistoryVC: TSBaseVC {
     lazy var navBarView: TSBaseNavContentBarView = {
         let navBarView = TSBaseNavContentBarView()
 
-        let label = UILabel.createLabel(text: "Creations".localized,font: .font(name: .KelsiFill,size: 28))
+        let label = UILabel.createLabel(text: "Creations",font: .font(name: .KelsiFill,size: 28))
         navBarView.barView.addSubview(label)
         label.snp.makeConstraints { make in
             make.centerY.equalToSuperview()
@@ -133,7 +133,7 @@ class TSGenerateHistoryVC: TSBaseVC {
     }
     
     override func viewWillAppear(_ animated: Bool) {
-        print("viewWillAppear")
+        super.viewWillAppear(animated)
     }
     
     @objc func clickNavRight() {

+ 8 - 1
AIEmoji/Business2/DisCover/TSGenerateHistoryVC/View/TSGenerateHistoryCell.swift

@@ -47,6 +47,12 @@ class TSGenerateHistoryCell: TSBaseCollectionCell {
                     generatePTPOperation.isSaveProcessToDB = true
                     generatePTPOperation.creatImage(oldModel: dataModel){ complete in }
                     generateView.setProgress(progress: 0)
+                }else{
+                    if let window = WindowHelper.getCurrentWindow() {
+                        kTextToastShared.show(atView: window,text: "1 task is processing".localized){
+                            TSGenerateHistoryVC.showPosition()
+                        }
+                    }
                 }
             }
         }
@@ -72,11 +78,12 @@ class TSGenerateHistoryCell: TSBaseCollectionCell {
     lazy var exampleView: UIView = {
         let exampleView = UIView()
         exampleView.backgroundColor = "#232323".uiColor.withAlphaComponent(0.3)
-        
+        exampleView.cornerRadius = 10.0
         exampleView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
             make.top.edges.equalTo(UIEdgeInsets(top: 4, left: 6, bottom: 4, right: 6))
         }
+        
         exampleView.isHidden = true
         return exampleView
     }()

+ 6 - 6
AIEmoji/Common/Purchase/TSPurchaseManager.swift

@@ -203,9 +203,9 @@ public class PurchaseManager: NSObject {
     }
 
     @objc public var isVip: Bool {
-#if DEBUG
-        return vipType != .none
-#endif
+//#if DEBUG
+//        return vipType != .none
+//#endif
         guard let expiresDate = expiredDate else {
             return false
         }
@@ -217,9 +217,9 @@ public class PurchaseManager: NSObject {
     }
 
     public var vipType: PremiumPeriod {
-#if DEBUG
-        return PremiumPeriod.year
-#endif
+//#if DEBUG
+//        return PremiumPeriod.year
+//#endif
         guard isVip, let type = vipInformation["type"] as? String else {
             return .none
         }

+ 1 - 1
AIEmoji/Common/TSRealmManager/TSRealmManager.swift

@@ -20,7 +20,7 @@ class TSRealmManager {
          ui大改版 - >5
          **/
    
-        let newSchemaVersion: UInt64 = 5
+        let newSchemaVersion: UInt64 = 6
         // 获取默认配置
         var config = Realm.Configuration.defaultConfiguration
         // 设置新版本号

+ 3 - 3
AIEmoji/Common/Tool/OperationQueue/V2/TSGenerateBaseOperation.swift

@@ -223,11 +223,11 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
         retryDownloadCount += 1
     }
     
-    let generatingText:String = "Processing".localized
+    let generatingText:String = "Generating".localized
     func downloadVideo(urlString:String,completion:@escaping (URL?)->Void){
         TSDownloadManager.getDownLoadVideo(urlString: urlString) { progress in
             let progressInt = Int(progress*10.0)
-            let progressString = "Processing".localized + " " + kPercentlocalized(90 + progressInt)
+            let progressString = self.generatingText + " " + kPercentlocalized(90 + progressInt)
             self.stateDatauPblished = (.progressString(progressString),nil)
             dePrint("生成后视频下载进度: \(progress)")
         } complete: { url, _ in
@@ -240,7 +240,7 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
             guard let self = self else { return }
             
             let progressInt = Int(progress*10.0)
-            let progressString = "Processing".localized + " " + kPercentlocalized(90 + progressInt)
+            let progressString = self.generatingText + " " + kPercentlocalized(90 + progressInt)
             stateDatauPblished = (.progressString(progressString),currentActionInfoModel)
             dePrint("生成后图片下载进度: \(progress)")
         } completion: { image in