Transcoding at lower bitrate for limited bandwidth (#58)
Hello!
To begin with, thanks a lot for Funkwhale and the Android application, which is delightful to use every day.
As mentioned in #58, the application does not yet have a way to reduce the amount of data exchanged between the player and the server. When streaming high-quality audio on 4G or 5G connection, it can get very costly if one does consume a lot of FLAC content. This PR is an attempt at solving this issue and is my first contribution to the project. I would appreciate some hints/helps according to unit tests, translations, and probably things I did not cover for the moment...
Here is a summary of what I have done:
- Add a new setting called "Bandwidth limitation" with an icon, and a basic description,
- If bandwidth limitation is set to limited, append
&to=mp3&max_bitrate=320
to the listen URL of the candidate best track upload.
A better way to do it in the future would be to add a bar to configure the desired maximum bitrate, and probably check in the cache if the best upload is already there before asking for a reduced one. Testing that the best quality upload is already meeting the bandwidth constraint would be interesting to avoid an unneeded transcoding on the server side. I prefer to point out the flaws so that we can discuss about them together!
Thank in advance,
Dylan