vhaudiquet / blade-player

Android music player that plays from local library, Spotify or Deezer
GNU General Public License v3.0
67 stars 12 forks source link

Improve / Replace song linking system #34

Open sagorahmed opened 5 years ago

sagorahmed commented 5 years ago

Actual behavior

The app crashes after I linked a song to another from the Artist folder and clicked on the previous/next track changer button of that song.

Expected behavior

I expected that after linking a song to another, the song will stop playing. But this not weirder than crashing the app by clicking on the next/previous button.

How to reproduce

  1. Open the app and go to "Artists" folder.
  2. Choose an artist and play a song from it.
  3. Click on ⋮ (Three dots/ Vertical ellipsis) at the right side of the song.
  4. Then click "Link to"
  5. Select a song from your local library. (The song will be successfully added to your chosen song & The song will still be playing in your player).
  6. Open the current playing song page by tapping on its name. (At the downside of your display).
  7. At last Click on the next button.
  8. See error.

Recording Of The Bug

bladebug

Logcat

04-05 00:16:02.421 26140 26140 E AndroidRuntime: FATAL EXCEPTION: main

04-05 00:16:02.421 26140 26140 E AndroidRuntime: Process: v.blade, PID: 26140

04-05 00:16:02.421 26140 26140 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'v.blade.library.sources.Source v.blade.library.SongSources$SongSource.getSource()' on a null object reference

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at v.blade.player.PlayerMediaPlayer.playSong(PlayerMediaPlayer.java:252)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at v.blade.player.PlayerService$2.onSkipToNext(PlayerService.java:157)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.support.v4.media.session.MediaSessionCompat$Callback$StubApi21.onSkipToNext(MediaSessionCompat.java:1284)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.support.v4.media.session.MediaSessionCompatApi21$CallbackProxy.onSkipToNext(MediaSessionCompatApi21.java:219)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.media.session.MediaSession$CallbackMessageHandler.handleMessage(MediaSession.java:1228)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

04-05 00:16:02.421 26140 26140 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
vhaudiquet commented 5 years ago

Ok ; thanks for reporting that. This confirms what i thought : the linking system is really bad and should be improved. I don't think that i will fix this bug, i prefer to remove the linking system of stable builds and improve / completely change it in development builds until it is ready. I'll close the issue after i'm done with that, but it might be in a long time...

sagorahmed commented 5 years ago

Hello @Valou3433,

I don't think that i will fix this bug, i prefer to remove the linking system of stable builds

I think you have made a great decision.