feat: added server-side track transcoding settings option

This commit is contained in:
antonio 2023-07-20 17:20:57 +02:00
parent b73a1c532b
commit 84db4060e6
7 changed files with 60 additions and 8 deletions

View file

@ -41,8 +41,11 @@ public class MusicUtil {
if (params.containsKey("c") && params.get("c") != null)
uri.append("&c=").append(params.get("c"));
uri.append("&maxBitRate=").append(getBitratePreference());
uri.append("&format=").append(getTranscodingFormatPreference());
if (!Preferences.isServerPrioritized())
uri.append("&maxBitRate=").append(getBitratePreference());
if (!Preferences.isServerPrioritized())
uri.append("&format=").append(getTranscodingFormatPreference());
uri.append("&id=").append(id);
Log.d(TAG, "getStreamUri: " + uri);

View file

@ -32,6 +32,7 @@ object Preferences {
private const val RADIO_SECTION_VISIBILITY = "radio_section_visibility"
private const val MUSIC_DIRECTORY_SECTION_VISIBILITY = "music_directory_section_visibility"
private const val REPLAY_GAIN_MODE = "replay_gain_mode"
private const val AUDIO_TRANSCODE_PRIORITY = "audio_transcode_priority"
@JvmStatic
fun getServer(): String? {
@ -252,4 +253,9 @@ object Preferences {
fun getReplayGainMode(): String? {
return App.getInstance().preferences.getString(REPLAY_GAIN_MODE, "disabled")
}
@JvmStatic
fun isServerPrioritized(): Boolean {
return App.getInstance().preferences.getBoolean(AUDIO_TRANSCODE_PRIORITY, false)
}
}