AlexandrePTJ / mopidy-somafm

Provides a backend for playing music from somafm
MIT License
22 stars 9 forks source link

Graceful degradation #24

Closed PanderMusubi closed 6 years ago

PanderMusubi commented 8 years ago

At the moment the configuration sets encoding and quality to a fixed value. However, SomaFM and Intergalactic FM do not support all combinations. The implementation should be that what is set is a desirable value, but if it is not found, via graceful degradation, another setting is tried and used.

For encoding, I would like to propose aacp -> aac -> mp3 and for quality highest -> fast -> slow. The default config has to change to aacp and highest.

Implementing this would expose more channels per online radio station and reduce confusion on the side of the user.

adamcik commented 8 years ago

You probably also want to wrap around, so say I prefer fast but only highest exists it should still work.

PanderMusubi commented 8 years ago

Or some fixed schemes such as:

highest -> fast -> slow
fast -> highest -> slow
slow -> highest -> fast

and

aacp -> aac -> mp3
aac -> aacp -> mp3
mp3 -> aac -> aacp

This is graceful degradation by upgrading first and then downgrading.

PanderMusubi commented 8 years ago

Reason for activating this scheme would be any kind of error, time out, non-existing url or whatever. If all options are exhausted, the next in the playlist should be played. I think, first all sorts of quality should be exhausted, then the next in line of encoding, starting out with the original set quality.

So if you have aacp&highest and nothing is available, the path should be aacp&fast, aacp&slow, aac&highest, aac&fast, aac&slow, mp3&highest, mp3&fast, mp3&slow and then next in playlist with aacp&highest, etc. Is that OK?

PanderMusubi commented 8 years ago

Sorry quality goes over format so the order would be aacp&highest -> aac&highest -> mp3&highest, aacp&fast, aac&fast, mp3&fast, ...

PanderMusubi commented 8 years ago

For Clementine I had to implement a minimal version of this as the support for SomaFM there only lists MP3 fast quality. See also https://github.com/clementine-player/Clementine/pull/5243 and perhaps someone would like to have a look there on how to extend support to AAC and extend the number of channels for SomaFM.

AlexandrePTJ commented 8 years ago

I don't think that making the extension change the configuration itself is a good idea.