feat: move off_air_meta stream setting to pref table (#2023)
This commit is contained in:
parent
e408237be1
commit
6c59ff588b
7 changed files with 59 additions and 15 deletions
44
api/libretime_api/legacy/migrations/0037_3_0_0_alpha_14_1.py
Normal file
44
api/libretime_api/legacy/migrations/0037_3_0_0_alpha_14_1.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
# pylint: disable=invalid-name
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
from ._migrations import legacy_migration_factory
|
||||
|
||||
UP = """
|
||||
insert into cc_pref ("keystr", "valstr")
|
||||
select
|
||||
"keyname" as "keystr",
|
||||
coalesce("value", 'LibreTime - offline') as "valstr"
|
||||
from cc_stream_setting
|
||||
where "keyname" = 'off_air_meta';
|
||||
|
||||
delete from cc_stream_setting
|
||||
where "keyname" = 'off_air_meta';
|
||||
"""
|
||||
|
||||
DOWN = """
|
||||
insert into cc_stream_setting ("keyname", "value", "type")
|
||||
select
|
||||
"keystr" as "keyname",
|
||||
coalesce("valstr", 'LibreTime - offline') as "value",
|
||||
'string' as "type"
|
||||
from cc_pref
|
||||
where "keystr" = 'off_air_meta';
|
||||
|
||||
delete from cc_pref
|
||||
where "keystr" = 'off_air_meta';
|
||||
"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("legacy", "0036_3_0_0_alpha_13_10"),
|
||||
]
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=legacy_migration_factory(
|
||||
target="3.0.0-alpha.14.1",
|
||||
sql=UP,
|
||||
)
|
||||
)
|
||||
]
|
|
@ -1 +1 @@
|
|||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.10"
|
||||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.14.1"
|
||||
|
|
|
@ -8,6 +8,7 @@ INSERT INTO cc_live_log ("state", "start_time") VALUES ('S', now() at time zone
|
|||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('import_timestamp', '0');
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('timezone', 'UTC');
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('default_stream_mount_point', 'main');
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('off_air_meta', 'LibreTime - offline');
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('enable_replay_gain', 1);
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('locale', 'en_US');
|
||||
INSERT INTO cc_pref ("keystr", "valstr") VALUES ('max_bitrate', '320');
|
||||
|
@ -24,7 +25,6 @@ INSERT INTO cc_subjs ("login", "type", "pass") VALUES ('admin', 'A', md5('admin'
|
|||
INSERT INTO cc_pref ("subjid", "keystr", "valstr") VALUES (1, 'user_locale', 'en_US');
|
||||
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('icecast_vorbis_metadata', 'false', 'boolean');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('off_air_meta', 'LibreTime - offline', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device_type', 'ALSA', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device', 'false', 'boolean');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue