As per Android policy and internal logic, we stopped the playback
foreground service when playback was paused. This made our PlayService
elligible for garbage collection by the OS. This had the consequences of
not allowing someone to pause playback and resume it after some time.
Android would always kill the service after around one minute.
This commit, on supported Android version (7.0+) detaches the
notification when stopping the foreground service, leaving the
notification in place even when the service is killed, allowing the user
to resume playback whenever they please.
We also had to move the MediaSession out of the service, for it to
remain alive between service killing and resurrection.
Scrolling through large lists was a pain. The next page would only load
when the end of the list was reached, stopping the scroll action while the new
page was fetched.
This commits adds two items:
* Artists, albums and playlists do not refresh data on resume, only
using cached data until manually refreshed.
* When manually refreshed, we initially fetch a few pages instead
of only one. Also, on scroll, we try as best as we can to always keep
10 pages (pages as in screen estate) worth of data loaded.
As of now, Otter cannot list albumless tracks (for example, tracks in
compilation, appearing under the original artist, but not part of an
album published by this artist). This created a lot of "empty" artists
(with no albums) in the Artists section of the app.
This may be rolled back if we are some day able to list "orphan"
tracks.
On top this fix, this commit adds support for "My content" and
"Favorites" instance radios (fixes#51), as well as clearly separates instance
radios from user radios.
Radios were a bit unusable when not logged in with an actual authorized
user account, this commit fixes the following elements:
* Anonymous users get a transient session cookie when starting a radio
session that was not stored and forwarded on playback, meaning no
radios would play;
* Anonymous users do not have their own own content. Thus, only the
"Random" radio makes sense in that context. This commit only display
the instance radios that are relevant to your authentication status.
"My content" radios needs the user ID to function properly, this commit
also adds retrieving it from the /api/v1/users/users/me/ endpoint, which
now may be used in the future for other purposes.