|
@@ -48,20 +48,26 @@ extension KMBatchProcessingTableViewPresenter: KMBatchProcessingTableViewPresent
|
|
|
}
|
|
|
|
|
|
func addData(data: [URL]) {
|
|
|
+ let types: [String] = KMBatchProcessingTableViewModel.supportedImageTypes()
|
|
|
for url in data {
|
|
|
- let model: KMBatchProcessingTableViewModel! = KMBatchProcessingTableViewModel.initWithFilePath(url: url)
|
|
|
- if (self.containsSampleFile(model: model)) {
|
|
|
- self.modelData.append(model)
|
|
|
+ if types.contains(url.pathExtension) {
|
|
|
+ let model: KMBatchProcessingTableViewModel! = KMBatchProcessingTableViewModel.initWithFilePath(url: url)
|
|
|
+ if (self.containsSampleFile(model: model)) {
|
|
|
+ self.modelData.append(model)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
self.delegate?.showData(presenter: self, data: self.modelData)
|
|
|
}
|
|
|
|
|
|
func insetData(data: [URL], index: Int) {
|
|
|
+ let types: [String] = KMBatchProcessingTableViewModel.supportedImageTypes()
|
|
|
for url in data {
|
|
|
- let model: KMBatchProcessingTableViewModel! = KMBatchProcessingTableViewModel.initWithFilePath(url: url)
|
|
|
- if (self.containsSampleFile(model: model)) {
|
|
|
- self.modelData.insert(model, at: index)
|
|
|
+ if types.contains(url.pathExtension) {
|
|
|
+ let model: KMBatchProcessingTableViewModel! = KMBatchProcessingTableViewModel.initWithFilePath(url: url)
|
|
|
+ if (self.containsSampleFile(model: model)) {
|
|
|
+ self.modelData.insert(model, at: index)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
self.delegate?.showData(presenter: self, data: self.modelData)
|