Skip to content

Commit

Permalink
Fix checking for file
Browse files Browse the repository at this point in the history
  • Loading branch information
GianniCarlo committed Apr 26, 2024
1 parent 4ee7ff3 commit 47649dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BookPlayer/Coordinators/LibraryListCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ class LibraryListCoordinator: ItemListCoordinator, UINavigationControllerDelegat
/// At some point (iOS 17?), the OS stopped sending the picked files to the Documents/Inbox folder, instead
/// it's now sent to a temp folder that can't be relied on to keep the file existing until the import is finished
if url.absoluteString.contains(temporaryDirectoryPath) {
try! FileManager.default.moveItem(at: url, to: documentsFolder)
let destinationURL = documentsFolder.appendingPathComponent(url.lastPathComponent)
if !FileManager.default.fileExists(atPath: destinationURL.path) {
try! FileManager.default.copyItem(at: url, to: destinationURL)
}
} else {
importManager.process(url)
}
Expand Down

0 comments on commit 47649dd

Please sign in to comment.