ON APP INIT
-
User has not login to Chrome: no server communication needed. only store data to local storage.
-
When user login to Chrome (profile_id is defined)
- check if user is in the database
[If yes]
- Override local data with remote data
[If not]
- signup user: this will create a user in the database
- upload local data to server (playlist, now playing, recent search)
save to database first. If success, save to local. If error, notify user.
- add/remove song to now playing
- create new playlist
- add/remove song to/from pla