2018-10-24 17:14:51 +00:00
|
|
|
from dynamic_preferences import types
|
|
|
|
from dynamic_preferences.registries import global_preferences_registry
|
|
|
|
|
|
|
|
music = types.Section("music")
|
|
|
|
|
|
|
|
|
|
|
|
@global_preferences_registry.register
|
|
|
|
class MaxTracks(types.BooleanPreference):
|
|
|
|
show_in_api = True
|
|
|
|
section = music
|
|
|
|
name = "transcoding_enabled"
|
|
|
|
verbose_name = "Transcoding enabled"
|
|
|
|
help_text = (
|
|
|
|
"Enable transcoding of audio files in formats requested by the client. "
|
|
|
|
"This is especially useful for devices that do not support formats "
|
|
|
|
"such as Flac or Ogg, but the transcoding process will increase the "
|
|
|
|
"load on the server."
|
|
|
|
)
|
|
|
|
default = True
|
2018-10-24 17:44:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
@global_preferences_registry.register
|
|
|
|
class MusicCacheDuration(types.IntPreference):
|
|
|
|
show_in_api = True
|
|
|
|
section = music
|
|
|
|
name = "transcoding_cache_duration"
|
|
|
|
default = 60 * 24 * 7
|
|
|
|
verbose_name = "Transcoding cache duration"
|
|
|
|
help_text = (
|
2018-10-26 13:37:43 +00:00
|
|
|
"How much minutes do you want to keep a copy of transcoded tracks "
|
|
|
|
"on the server? Transcoded files that were not listened in this interval "
|
|
|
|
"will be erased and retranscoded on the next listening."
|
2018-10-24 17:44:31 +00:00
|
|
|
)
|
|
|
|
field_kwargs = {"required": False}
|