Author Topic: MusicBee API -- "Continuous" Streams Start 'twice' breaking NowPlaying API  (Read 1423 times)

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
Hi Steven,

I've been encountering an issue while updating my add-in. You can see the full thread here:

https://getmusicbee.com/forum/index.php?topic=25944.60

I figured out that when you change from a normal music track to a 'continuous' stream, it begins by sending one "track changed" notification, but carries over a random selection of the data from the last track played (size, file URL, duration, etc.).

Less than a second afterwards, it sends another "track changed" notification, and updates all of the NowPlaying data to the correct values for the stream (size N/A and duration -1).

Here is a log of it occurring with the duration of the track:




3/2/2019 3:54:25 PM:


 Track changed or Plugin Startup.
3/2/2019 3:54:25 PM: Current Song Duration: 336432
3/2/2019 3:54:25 PM: Get file path.
3/2/2019 3:54:25 PM: Raw Title: Something to Believe In-DRS ft. Calibre-1586-173 ////// Processed Title: SomethingtoBelieveIn-DRSft.Calibre-1586-173
3/2/2019 3:54:25 PM: Size: 9.6 MB
3/2/2019 3:54:30 PM:


 Track changed or Plugin Startup.
3/2/2019 3:54:30 PM: Current Song Duration: 336432
3/2/2019 3:54:30 PM: Get file path.
3/2/2019 3:54:30 PM: Raw Title: Heights-Melorman-1586-173 ////// Processed Title: Heights-Melorman-1586-173
3/2/2019 3:54:30 PM: Size: N/A
3/2/2019 3:54:30 PM:


 Track changed or Plugin Startup.
3/2/2019 3:54:30 PM: Current Song Duration: -1
3/2/2019 3:54:30 PM: Get file path.
3/2/2019 3:54:30 PM: Raw Title: Heights-Melorman-1586-173 ////// Processed Title: Heights-Melorman-1586-173
3/2/2019 3:54:30 PM: Size: N/A
3/2/2019 3:54:36 PM:




Thanks!
Last Edit: March 03, 2019, 10:47:07 PM by zkhcohen

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
I am not able to reproduce any issues ie. the "track changed" notification has the correct info initially for the details captured in the radio station definition, although i do agree you will get a 2nd notification 1-few seconds afterwards after the embedded stream metadata is loaded for the current playing song on the station - this is expected and should be the same url but could differ in artist/ track title etc.
- You definitely are not using the "track changing" event?
- And the file url that is sent is definitely inconsistent?
- And how do you switch between the local track and the radio station - you let the local track run to completion or double click the station while the local track is still playing?

edit:
- also what API call are you using to retrieve the information?
Last Edit: March 03, 2019, 04:13:36 PM by Steven

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
I am not able to reproduce any issues ie. the "track changed" notification has the correct info initially for the details captured in the radio station definition, although i do agree you will get a 2nd notification 1-few seconds afterwards after the embedded stream metadata is loaded for the current playing song on the station - this is expected and should be the same url but could differ in artist/ track title etc.
- You definitely are not using the "track changing" event?
- And the file url that is sent is definitely inconsistent?
- And how do you switch between the local track and the radio station - you let the local track run to completion or double click the station while the local track is still playing?

edit:
- also what API call are you using to retrieve the information?

Hey! First to answer your questions:

1. NotificationType.TrackChanged
2. Sometimes, yes.
3. Double-click the station shortly after the local track is started. It occurs MUCH more frequently when you switch between them quickly.

I made you a really simple add-in which will replicate the issue. The .dll is in the /bin/debug directory.

The source code is included.

To replicate, just play a track, then very quickly switch to a stream with 'continuous' in its time column. Streams with 0:00 don't work.


https://www.mediafire.com/file/cter1ybi4alxyhj/TEST-API.zip/file



Here's proof of it happening using this add-in in 3.3.6996:


 Track changed.
3/3/2019 11:56:36 AM: Size: 13.9 MB
 Duration: 5:55
 URL: C:\Users\Zachary\Desktop\Core File\Music\Electronic-House-Dance-Hardstyle-Jumpstyle\Solomun - Something We All Adore (Original Mix).mp3
 Kind: MPEG audio file
3/3/2019 11:56:39 AM:



<I STARTED THE STREAM HERE...>


 Track changed.
3/3/2019 11:56:39 AM: Size: 13.9 MB
 Duration: 5:55
 URL: C:\Users\Zachary\Desktop\Core File\Music\Electronic-House-Dance-Hardstyle-Jumpstyle\Solomun - Something We All Adore (Original Mix).mp3
 Kind: MPEG audio file
3/3/2019 11:56:39 AM:


 Track changed.
3/3/2019 11:56:39 AM: Size: N/A
 Duration: Continuous
 URL: http://ice3.somafm.com/groovesalad-256-mp3
 Kind: MP3 Stream

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
I still cant reproduce, however i can see one bit of undesirable code that for radio stations that can be removed and i think it should solve the issue

https://getmusicbee.com/patches/MusicBee33_Patched.zip

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
I still cant reproduce, however i can see one bit of undesirable code that for radio stations that can be removed and i think it should solve the issue

https://getmusicbee.com/patches/MusicBee33_Patched.zip


Hey! It's fixed. Thanks.