From b2e512cbcd34711cbc480d63cb263566a1b0bdb7 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Sat, 14 Oct 2023 09:13:04 +0200 Subject: [PATCH] feat: add mobile devices stream config field (#2744) --- docker/config.template.yml | 8 ++++++++ docker/config.yml | 8 ++++++++ docker/example/config.yml | 8 ++++++++ docs/admin-manual/configuration.md | 8 ++++++++ installer/config.yml | 8 ++++++++ legacy/application/configs/conf.php | 2 ++ legacy/application/models/StreamSetting.php | 2 +- shared/libretime_shared/config/_models.py | 4 ++++ 8 files changed, 47 insertions(+), 1 deletion(-) diff --git a/docker/config.template.yml b/docker/config.template.yml index 8d9f4b34d..5cb702734 100644 --- a/docker/config.template.yml +++ b/docker/config.template.yml @@ -264,6 +264,10 @@ stream: # Icecast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # Shoutcast output streams. # > max items is 1 shoutcast: @@ -309,6 +313,10 @@ stream: # Shoutcast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # System outputs. # > max items is 1 system: diff --git a/docker/config.yml b/docker/config.yml index ef2b8059e..27892d0c5 100644 --- a/docker/config.yml +++ b/docker/config.yml @@ -264,6 +264,10 @@ stream: # Icecast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # Shoutcast output streams. # > max items is 1 shoutcast: @@ -309,6 +313,10 @@ stream: # Shoutcast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # System outputs. # > max items is 1 system: diff --git a/docker/example/config.yml b/docker/example/config.yml index cb183fc33..f5020f1b3 100644 --- a/docker/example/config.yml +++ b/docker/example/config.yml @@ -264,6 +264,10 @@ stream: # Icecast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # Shoutcast output streams. # > max items is 1 shoutcast: @@ -309,6 +313,10 @@ stream: # Shoutcast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # System outputs. # > max items is 1 system: diff --git a/docs/admin-manual/configuration.md b/docs/admin-manual/configuration.md index 0ca40661e..faa017f5b 100644 --- a/docs/admin-manual/configuration.md +++ b/docs/admin-manual/configuration.md @@ -451,6 +451,10 @@ stream: website: "https://libretime.org" # Icecast stream genre. genre: "various" + + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false ``` #### Shoutcast @@ -504,6 +508,10 @@ stream: website: "https://libretime.org" # Shoutcast stream genre. genre: "various" + + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false ``` #### System diff --git a/installer/config.yml b/installer/config.yml index ea059cee2..69940446c 100644 --- a/installer/config.yml +++ b/installer/config.yml @@ -264,6 +264,10 @@ stream: # Icecast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # Shoutcast output streams. # > max items is 1 shoutcast: @@ -309,6 +313,10 @@ stream: # Shoutcast stream genre. genre: various + # Whether the stream should be used for mobile devices. + # > default is false + mobile: false + # System outputs. # > max items is 1 system: diff --git a/legacy/application/configs/conf.php b/legacy/application/configs/conf.php index f21e471a4..42fa9002a 100644 --- a/legacy/application/configs/conf.php +++ b/legacy/application/configs/conf.php @@ -171,6 +171,7 @@ class Schema implements ConfigurationInterface /* */->scalarNode('description')->end() /* */->scalarNode('website')->end() /* */->scalarNode('genre')->end() + /* */->booleanNode('mobile')->defaultFalse()->end() /**/->end()->end()->end() // Shoutcast outputs @@ -200,6 +201,7 @@ class Schema implements ConfigurationInterface /* */->scalarNode('name')->end() /* */->scalarNode('website')->end() /* */->scalarNode('genre')->end() + /* */->booleanNode('mobile')->defaultFalse()->end() /**/->end()->end()->end() // System outputs diff --git a/legacy/application/models/StreamSetting.php b/legacy/application/models/StreamSetting.php index 718154e08..04e322d16 100644 --- a/legacy/application/models/StreamSetting.php +++ b/legacy/application/models/StreamSetting.php @@ -62,7 +62,7 @@ class Application_Model_StreamConfig $prefix . 'description' => $output['description'] ?? '', $prefix . 'genre' => $output['genre'] ?? '', $prefix . 'url' => $output['website'] ?? '', - $prefix . 'mobile' => 'false', + $prefix . 'mobile' => $output['mobile'] ?? 'false', // $prefix . 'liquidsoap_error' => 'waiting', ]; } diff --git a/shared/libretime_shared/config/_models.py b/shared/libretime_shared/config/_models.py index 094d763c3..13e70927a 100644 --- a/shared/libretime_shared/config/_models.py +++ b/shared/libretime_shared/config/_models.py @@ -220,6 +220,8 @@ class IcecastOutput(BaseModel): website: Optional[str] = None genre: Optional[str] = None + mobile: bool = False + _mount_no_leading_slash = no_leading_slash_validator("mount") @@ -244,6 +246,8 @@ class ShoutcastOutput(BaseModel): website: Optional[str] = None genre: Optional[str] = None + mobile: bool = False + class SystemOutputKind(str, Enum): ALSA = "alsa"