Skip to content

Commit

Permalink
Possible fix to import order
Browse files Browse the repository at this point in the history
  • Loading branch information
GianniCarlo committed Nov 15, 2021
1 parent fb781e9 commit 9da88c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions BookPlayer/Import/Models/ImportOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ public class ImportOperation: Operation {
}

func finish() {
let sortDescriptor = NSSortDescriptor(key: "path", ascending: true, selector: #selector(NSString.localizedStandardCompare(_:)))
let orderedSet = NSOrderedSet(array: self.processedFiles)

if let sortedFiles = orderedSet.sortedArray(using: [sortDescriptor]) as? [URL] {
self.processedFiles = sortedFiles
}

isExecuting = false
isFinished = true
}
Expand Down

0 comments on commit 9da88c7

Please sign in to comment.