|
@@ -76,7 +76,7 @@ public class PQStuckPointViewModel: NSObject {
|
|
|
/// - totalDuration: 选择素材总时长
|
|
|
/// - complateHandle: <#complateHandle description#>
|
|
|
/// - Returns: <#description#>
|
|
|
- class func stuckPointMusicPageList(tagId: Int64, parentTagId: Int64 = 0, pageNum: Int = 1, pageSize: Int = 20,videoCount: Int = 0, imageCount: Int = 0, totalDuration: Float64 = 0, complateHandle: @escaping (_ musicPageList: [PQVoiceModel], _ msg: String?) -> Void) {
|
|
|
+ class func stuckPointMusicPageList(tagId: Int64, parentTagId: Int64 = 0, pageNum: Int = 1, pageSize: Int = 20,videoCount: Int = 0, imageCount: Int = 0, totalDuration: Float64 = 0, oldDataMusic:[PQVoiceModel]? = nil, complateHandle: @escaping (_ musicPageList: [PQVoiceModel], _ msg: String?) -> Void) {
|
|
|
SWNetRequest.postRequestData(url: PQENVUtil.shared.longvideoapi + stuckPointMusicPageUrl, parames: ["tagId": tagId, "parentTagId": parentTagId, "pageNum": pageNum, "pageSize": pageSize]) { response, _, error, _ in
|
|
|
var musicPageList = Array<PQVoiceModel>.init()
|
|
|
if response is NSNull || response == nil {
|
|
@@ -95,7 +95,14 @@ public class PQStuckPointViewModel: NSObject {
|
|
|
if tempMusic.endTime <= tempMusic.startTime {
|
|
|
tempMusic.endTime = tempMusic.startTime + 40
|
|
|
}
|
|
|
- musicPageList.append(tempMusic)
|
|
|
+
|
|
|
+ let haveIndex = oldDataMusic?.firstIndex(where: { (music) -> Bool in
|
|
|
+ (music.musicId == tempMusic.musicId)
|
|
|
+ })
|
|
|
+ if(haveIndex == nil){
|
|
|
+ musicPageList.append(tempMusic)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
complateHandle(musicPageList, nil)
|