JayThomason / Tutti

Tutti is a shared music application for the car being made in conjunction with Audi.
3 stars 1 forks source link

Bugfix: Clients joining before all local music is loaded in #185

Closed hwray closed 10 years ago

hwray commented 10 years ago

Because the local music is actually being loaded on a background thread now, we have to consider the possibility that remote clients might be accepted to the Jam before the Master phone has loaded all its music. In this case, the remote client would not receive the Master's entire library, but just what was loaded at the time it joined.

I think the best way to solve this is to set some kind of "Loading local music..." spinner or alert that takes precedence over other notifications and user actions while loading the local music library in the background.

hwray commented 10 years ago

I got this solved in a slightly hacky way for now. I made the local MusicLibraryLoaderThread global and join() it in MainActivity (just before the master phone forwards to the music browser) and JoinJamActivity (just before the client phone exchanges libraries with the master and forwards to the browser). It results in a delay of a couple seconds if the user really races to start the Jam, so we should add some sort of spinning loader or something, as suggested by Jay here:

https://github.com/JayThomason/Tutti/issues/151