diff --git a/jmc.xcodeproj/project.xcworkspace/xcuserdata/johnmoody.xcuserdatad/UserInterfaceState.xcuserstate b/jmc.xcodeproj/project.xcworkspace/xcuserdata/johnmoody.xcuserdatad/UserInterfaceState.xcuserstate index 690b2c5..a4991d4 100644 Binary files a/jmc.xcodeproj/project.xcworkspace/xcuserdata/johnmoody.xcuserdatad/UserInterfaceState.xcuserstate and b/jmc.xcodeproj/project.xcworkspace/xcuserdata/johnmoody.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/jmc/Backend/Database:Filesystem Management/DatabaseManager.swift b/jmc/Backend/Database:Filesystem Management/DatabaseManager.swift index 2d547eb..c5cb312 100644 --- a/jmc/Backend/Database:Filesystem Management/DatabaseManager.swift +++ b/jmc/Backend/Database:Filesystem Management/DatabaseManager.swift @@ -496,12 +496,13 @@ class DatabaseManager: NSObject { func getNonAudioFiles(inDirectory directory: URL) -> [(URL, CFString)]? { do { var currentDirectoryAddableFiles = [(URL, CFString)]() - let enumerator = fileManager.enumerator(atPath: directory.path) - for fileObject in enumerator! { - guard let file = fileObject as? URL else { continue } - if let uti = (try? file.resourceValues(forKeys: [.typeIdentifierKey]))?.typeIdentifier as CFString? { - if UTTypeConformsTo(uti, kUTTypeImage) || UTTypeConformsTo(uti, kUTTypePDF) || UTTypeConformsTo(uti, kUTTypeLog) || UTTypeConformsTo(uti, kUTTypeText) || file.pathExtension.lowercased() == "cue" { - currentDirectoryAddableFiles.append((file, uti)) + if let enumerator = fileManager.enumerator(atPath: directory.path) { + for fileObject in enumerator { + guard let file = fileObject as? URL else { continue } + if let uti = (try? file.resourceValues(forKeys: [.typeIdentifierKey]))?.typeIdentifier as CFString? { + if UTTypeConformsTo(uti, kUTTypeImage) || UTTypeConformsTo(uti, kUTTypePDF) || UTTypeConformsTo(uti, kUTTypeLog) || UTTypeConformsTo(uti, kUTTypeText) || file.pathExtension.lowercased() == "cue" { + currentDirectoryAddableFiles.append((file, uti)) + } } } } @@ -697,6 +698,7 @@ class DatabaseManager: NSObject { track.volume = newVolume let newSourceListItemForVolume = NSEntityDescription.insertNewObject(forEntityName: "SourceListItem", into: subContext) as! SourceListItem newSourceListItemForVolume.volume = newVolume + newSourceListItemForVolume.name = newVolume.name (subContext.object(with: globalRootLibrarySourceListItem!.objectID) as! SourceListItem).addToChildren(newSourceListItemForVolume) addedVolumes[volumeURL] = newVolume } diff --git a/jmc/Backend/Database:Filesystem Management/iTunesLibraryParser.swift b/jmc/Backend/Database:Filesystem Management/iTunesLibraryParser.swift index 697e626..b1893fe 100644 --- a/jmc/Backend/Database:Filesystem Management/iTunesLibraryParser.swift +++ b/jmc/Backend/Database:Filesystem Management/iTunesLibraryParser.swift @@ -35,6 +35,7 @@ class iTunesLibraryParser: NSObject { var albumsWithUnknownArtists = [Album]() func makeLibrary(parentLibrary: Library?, visualUpdateHandler: ProgressBarController?) { + //volume? let subContext = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType) subContext.parent = managedContext let library = subContext.object(with: parentLibrary!.objectID) as? Library diff --git a/jmc/Other Windows/InitialSetupWindowController.swift b/jmc/Other Windows/InitialSetupWindowController.swift index 97ea6c7..a6a312c 100644 --- a/jmc/Other Windows/InitialSetupWindowController.swift +++ b/jmc/Other Windows/InitialSetupWindowController.swift @@ -44,7 +44,7 @@ class InitialSetupWindowController: NSWindowController { @IBOutlet weak var modifyMetadataCheckBox: NSButton! @IBOutlet weak var libraryPathControl: NSPathControl! - var organizationType: LibraryOrganizationType = .move + var organizationType: LibraryOrganizationType = .none var modifyMetadata: Bool = false var directoryURL: URL? var library: Library? @@ -119,6 +119,7 @@ class InitialSetupWindowController: NSWindowController { } else { centralURL = jmcDirURL } + return } else { centralURL = jmcDirURL }