|
@@ -718,13 +718,18 @@ extension TSEditAudioVC {
|
|
|
if isThereAnyChange() == false {
|
|
|
TSFileManagerTool.copyFileWithOverwrite(from: editOriginalURL, to: savePath)
|
|
|
copyModel.documentPath = savePath.path.documentLastURLString
|
|
|
+ //如果列表中有重名的,就加上时间戳
|
|
|
+ if let _ = TSMineRintoneHistory.shared.listModels.first(where: {$0.title == copyModel.title}){
|
|
|
+ copyModel.title = getModelNewTitle(title: copyModel.title)
|
|
|
+ }
|
|
|
completion?(copyModel, nil, savePath)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
copyModel.duration = Int(endDuration - startDuration)
|
|
|
TSRingLoadingView.shared.showWindow()
|
|
|
- audioTool.startTansformAudio(url:editOriginalURL.path, from: startDuration, to: endDuration, fadeIn: Double(fadeInDuration), fadeOut: Double(fadeOutDuration),addVolume: Double(outputVolume) ,savePath: savePath.path) { filePath, errMsg in
|
|
|
+ audioTool.startTansformAudio(url:editOriginalURL.path, from: startDuration, to: endDuration, fadeIn: Double(fadeInDuration), fadeOut: Double(fadeOutDuration),addVolume: Double(outputVolume) ,savePath: savePath.path) { [weak self] filePath, errMsg in
|
|
|
+ guard let self = self else { return }
|
|
|
DispatchQueue.main.async {
|
|
|
TSRingLoadingView.shared.remove()
|
|
|
}
|
|
@@ -743,7 +748,7 @@ extension TSEditAudioVC {
|
|
|
|
|
|
//如果列表中有重名的,就加上时间戳
|
|
|
if let _ = TSMineRintoneHistory.shared.listModels.first(where: {$0.title == copyModel.title}){
|
|
|
- copyModel.title = copyModel.title.removeTimestampFromEnd() + Date.timestampString
|
|
|
+ copyModel.title = self.getModelNewTitle(title: copyModel.title)
|
|
|
}
|
|
|
|
|
|
completion?(copyModel, errMsg, savePath)
|
|
@@ -753,6 +758,9 @@ extension TSEditAudioVC {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func getModelNewTitle(title:String)->String{
|
|
|
+ return title.removeTimestampFromEnd() + "_" + Date.timestampString
|
|
|
+ }
|
|
|
|
|
|
//是否有改动,调整过编辑参数
|
|
|
func isThereAnyChange() -> Bool{
|