BobbyESP / Metadator

An Android ID3 metadata editor and music player built with Jetpack Compose and Material 3
GNU Affero General Public License v3.0
59 stars 1 forks source link

[App crash] When openning edit page #5

Open pxeemo opened 2 months ago

pxeemo commented 2 months ago

Everytime I want to edit the data of a song this crash appears:

java.lang.IllegalStateException: Spotify API is null
    at O3.c.b(SourceFile:78)
    at O3.b.q(SourceFile:12)
    at d6.a.k(SourceFile:9)
    at z6.G.run(SourceFile:113)
    at android.os.Handler.handleCallback(Handler.java:959)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8499)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
    Suppressed: E6.f: [D{Cancelling}@fd1951b, Dispatchers.Main.immediate]
BobbyESP commented 2 months ago

Thanks for the report. I'll take a look at the fix as fast as possible

pxeemo commented 2 months ago

Thank you. Guess it's kind of a network error on the first launch, and it will fix itself when you establish the connection. But shouldn't it only happen when you tap on download icon to get metadata from Spotify?

BobbyESP commented 2 months ago

But shouldn't it only happen when you tap on download icon to get metadata from Spotify?

Indeed, but I made to obtain the Spotify app credentials once you open the edition page so that the user doesn't have to wait for the token to be received.

This has been changed and now the token will be retrieved once the user clicks on the retrieve metadata button

pxeemo commented 2 months ago

It's actually a good idea! The crash can also be handled by displaying it as a snackbar or showing the network error in the retriever bottom sheet if you wanted to be like that.

BobbyESP commented 2 months ago

Showing the network error in the retriever bottom sheet if you wanted to be like that.

This was what I've just done. Thanks for the report!

I'll think of using snackbars, but for I don't really like their UI, they are still in the Material 2 implementation

BobbyESP commented 2 months ago

https://github.com/user-attachments/assets/7c6c8413-91fc-431c-a2c8-8be6166c10af