Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after importing any M3U file through 3rd party file manager #700

Open
4 tasks done
Thoerix opened this issue Jan 30, 2024 · 1 comment
Open
4 tasks done

Crash after importing any M3U file through 3rd party file manager #700

Thoerix opened this issue Jan 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working music Related to music loading non-criticial Will fix later

Comments

@Thoerix
Copy link

Thoerix commented Jan 30, 2024

Describe the Bug/Crash

After launching the app, go to the playlist tab and try to import a playlist. The native file manager will open. Click on the hamburger icon and select any 3rd party file manager. Selecting any M3U file from there will instantly crash Auxio ( Weirdly, GDrive is an exception - Auxio just refuses to load anything from it and toasts "Unable to import a playlist from this file." message )

Might be related to #693 and #673

Describe the intended behavior

It should load it. Tested on two other devices and the result is the same

What android version do you use?

Android 13

What device model do you use?

Xiaomi POCO F3

Bug report

java.lang.IllegalArgumentException: Invalid URI: content://media/external/file/1000014949
at android.provider.DocumentsContract.getDocumentId(DocumentsContract.java:1278)
at org.oxycblt.auxio.music.fs.DocumentPathFactoryImpl.unpackDocumentUri(SourceFile:6)
at org.oxycblt.auxio.music.MusicViewModel$importPlaylist$1.invokeSuspend(SourceFile:50)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
at kotlinx.coroutines.DispatchedTask.run(Unknown Source:94)
at androidx.fragment.app.Fragment$4.run(SourceFile:43)
at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:92)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@7ee72c4, Dispatchers.IO]

Sometimes the URI is different, depending on the file manager. It can look something like this:
java.lang.IllegalArgumentException: Invalid URI: content://{file manager's package name}/file/{URL encoded path to the file, starting with :///storage/emulated/ }

Duplicates

@Thoerix Thoerix added the bug Something isn't working label Jan 30, 2024
@OxygenCobalt
Copy link
Owner

OxygenCobalt commented Jan 31, 2024

Since Auxio needs the path of an M3U file to generate relative M3U paths, it uses some really cursed hacks that decodes the path information from the URI given. It's pretty brittle and was only designed with the native file manager.

  • I can likely handle 3rd party file managers as content://{file manager's package name}/file/{URL encoded path to the file, starting with :///storage/emulated/ }
  • content://media/external/file/1000014949 is likely a MediaStore entry of some sort. Need to research this.
  • I doubt I'll be able to support Google Drive files, those have no real "path" information. Maybe I could support them in an absolute path form only, but then I would have to indicate that I had to do that. I'll likely just leave them unsupported since SAF-based music loading #322 will make that redundant anyway.

@OxygenCobalt OxygenCobalt added the music Related to music loading label Feb 3, 2024
@OxygenCobalt OxygenCobalt added the non-criticial Will fix later label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working music Related to music loading non-criticial Will fix later
Projects
None yet
Development

No branches or pull requests

2 participants