Bug 1089718 - [music] Make the metadata parser sane

On the flame, I think the two storage areas are /storage/sdcard0 and /storage/sdcard1, right? So wouldn't this function return "/storage/" for both internal and external storage?

I think that the objects returned by navigator.getDeviceStorages() have a property that specifies their path prefix, so I think you could loop through those and use filename.startsWith() to determine the match.  (Actually, if you wanted to you could then return the DeviceStorage object from this function)