jcm93 / jmc

jmc - a new macOS media organizer
Other
497 stars 21 forks source link

jmc crashes when adding to library #6

Closed casedefault closed 7 years ago

casedefault commented 7 years ago

To reproduce:

  1. Central media location set to default location on internal SSD
  2. 'Keep newly added media organised' is unchecked
  3. File -> Add to library -> Select folder on SMB share with ~640 tracks in it

Terminal output when launching the app from the CLI:

max block size 4608
min block sie 4608
bits per sample 16
doingus
poopie
fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0    libswiftCore.dylib                 0x0000000103f16130 swift_reportError + 129
1    libswiftCore.dylib                 0x0000000103f32b50 _swift_stdlib_reportFatalError + 60
2    libswiftCore.dylib                 0x0000000103d23250 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
3    libswiftCore.dylib                 0x0000000103e9de90 partial apply for (_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #2) + 109
4    libswiftCore.dylib                 0x0000000103d23250 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
5    libswiftCore.dylib                 0x0000000103e509a0 specialized _fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never + 96
6    jmc                                0x0000000103226470 DatabaseManager.getAudioMetadata(url : URL) -> [String : Any]? + 14328
7    jmc                                0x000000010322b830 DatabaseManager.addTracksFromURLs([URL], to : Library, visualUpdateHandler : ProgressBarController?, callback : () -> ()?) -> [FileAddToDatabaseError] + 1554
8    jmc                                0x00000001032038b0 AddFilesQueueLoop.(loopAction(timer : Timer) -> ()).(closure #1) + 769
9    jmc                                0x000000010318b370 thunk + 39
10   libdispatch.dylib                  0x0000000104e3d518 _dispatch_call_block_and_release + 12
11   libdispatch.dylib                  0x0000000104e348f4 _dispatch_client_callout + 8
12   libdispatch.dylib                  0x0000000104e42eaf _dispatch_queue_override_invoke + 743
13   libdispatch.dylib                  0x0000000104e364d9 _dispatch_root_queue_drain + 476
14   libdispatch.dylib                  0x0000000104e36429 _dispatch_worker_thread3 + 99
15   libsystem_pthread.dylib            0x0000000104fe408f _pthread_wqthread + 1299
16   libsystem_pthread.dylib            0x0000000104fe4070 start_wqthread + 13
[1]    64674 illegal hardware instruction  ./jmc

Notes:

Let me know if there's any more information I can provide.

jcm93 commented 7 years ago

Indeed, I never tested WAVs. I had assumed the Spotlight API would carry bit rate info for WAVs but clearly not. I will post a fix for this later.

Thanks for the detailed report!

jcm93 commented 7 years ago

Seems like .WAVs do indeed have audio metadata on my machine. Can you run mdls [your wav file].wav on your machine and tell me the output? This could be a filesystem issue where I need to find another way to get metadata for things like files on SMB shares.

jcm93 commented 7 years ago

6fdbe73 fixes this crash; import failure will be a separate issue, if indeed audio metadata can't be accessed for files on network shares.