From 17da28cc1b408d761ca17fd96efd3ead7caef3e7 Mon Sep 17 00:00:00 2001 From: David Cooper Date: Wed, 14 Aug 2024 16:33:03 -0400 Subject: [PATCH] Fix docs --- docs/docs_macros.py | 13 ++++++++++++- server/constants.json | 4 ++-- server/tomato/settings.py | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/docs_macros.py b/docs/docs_macros.py index 808975a3..317a8e8d 100644 --- a/docs/docs_macros.py +++ b/docs/docs_macros.py @@ -1,6 +1,6 @@ import decimal -import sys from pathlib import Path +import sys from unittest.mock import Mock @@ -14,6 +14,7 @@ TYPE_HINTS_TO_STRING = { "audio_bitrate": "32kbps through 320kbps", "ui_modes": "Simple, standard, and/or advanced mode", + "clock": "Off, 12-hour, and 24-hour", } @@ -50,6 +51,16 @@ def get_constance_config_default(name, default): return f"{default}kbps" elif name == "UI_MODES": return "Simple & standard mode" + elif name == "CLOCK": + return "Off" + elif name in ( + "UI_MODE_RESET_TIMES", + "REJECT_SILENCE_LENGTH", + "NO_REPEAT_ASSETS_TIME", + "STOPSET_OVERDUE_TIME", + "END_DATE_PRIORITY_WEIGHT_MULTIPLIER", + ): + return "0 (feature disabled)" return repr(default) diff --git a/server/constants.json b/server/constants.json index 5fae4c94..6d9d855d 100644 --- a/server/constants.json +++ b/server/constants.json @@ -114,7 +114,7 @@ "settings_descriptions": { "ALLOW_REPEATS_IN_STOPSET": "The randomization algorithm will try its absolute best to avoid duplicates. However, when that's not possible (for example because of a nearly empty rotator), do you want the same asset to repeat (True), or for the rotator to be ignored in a given stop set (False)?", "BROADCAST_COMPRESSION": "Enable broadcast compression when True, smoothing out dynamic range in audio output.\nNOTE: compression is applied at the time you play an audio asset and performed on-the-fly in the desktop app.", - "CLOCK": "This will enable a clock that displays the current time in the desktop app (12 or 24-hour). On larger screens the date will also display.", + "CLOCK": "This will enable a clock that displays the current time in the desktop app (12- or 24-hour display). On larger screens the date will also display.", "END_DATE_PRIORITY_WEIGHT_MULTIPLIER": "Multiply an asset's weight by this number if it has an end date and the end date is in the next 24 hours (one day). Set to 0 to disable this feature.", "NO_REPEAT_ASSETS_TIME": "The time (in seconds) required to elapse for the Desktop app to attempt to not repeat any assets. Set to 0 to disable and allow potential repetition in the randomization algorithm. If there are not enough assets in a rotator to respect this setting, it will be ignored.", "ONE_CLIENT_LOGIN_PER_ACCOUNT": "Only allow one desktop client to be connected per account.", @@ -122,7 +122,7 @@ "STOPSET_OVERDUE_TIME": "The time (in seconds) after the WAIT_INTERVAL after which an \"overdue\" message will flash. Set to 0 disable.", "STOPSET_PRELOAD_COUNT": "Number of stopsets to preload in the UI. 2 or 3 are good values for this, since new data could make preloaded ones stale.", "UI_MODES": "Restrict what user interface modes are available to the desktop app.", - "UI_MODE_RESET_TIMES": "Reset UI mode to the simplest enabled mode according to this setting. Enter a list of times (HH:MM format) with each time on a single line. Set to 0 disable. The below example would reset the UI mode at midnight, 6am, noon, and 6pm:\n\n00:00\n06:00\n12:00\n18:00", + "UI_MODE_RESET_TIMES": "Reset UI mode to the simplest enabled mode according to this setting. Enter a list of times (in 24-hour HH:MM format) with each time on a single line. Set to 0 disable. The below example would reset the UI mode at midnight, 6am, noon, and 6pm:\n\n00:00\n06:00\n12:00\n18:00", "WAIT_INTERVAL": "Time to wait between stop sets (in seconds). Set to 0 to disable the wait interval entirely.", "WAIT_INTERVAL_SUBTRACTS_FROM_STOPSET_PLAYTIME": "Wait time subtracts the playtime of a stop set in minutes when True. When enabled Tomato will provide more even results, ie the number of stop sets played per hour will be more consistent at the possible expense of an individual DJs air time.", "WAIT_INTERVAL_SUBTRACTS_FROM_STOPSET_PLAYTIME_MIN_LENGTH": "When WAIT_INTERVAL_SUBTRACTS_FROM_STOPSET_PLAYTIME is set to True, wait intervals are of variable length. A very long stopset might naively result in a negative wait interval. This setting avoids that by setting minimum wait interval length (in seconds).", diff --git a/server/tomato/settings.py b/server/tomato/settings.py index 8490d5c0..a34c54a5 100644 --- a/server/tomato/settings.py +++ b/server/tomato/settings.py @@ -442,9 +442,9 @@ def validate_reset_times(values): "UI_MODE_RESET_TIMES": ( "0", mark_safe( - "Reset UI mode to the simplest enabled mode according to this setting. Enter a list of times" - " (HH:MM format) with each time on a single line. Set to 0 disable. The below" - " example would reset the UI mode at midnight, 6am, noon, and" + "Reset UI mode to the simplest enabled mode according to this setting. Enter a list of times (in 24-hour" + " HH:MM format) with each time on a single line. Set to 0 disable." + " The below example would reset the UI mode at midnight, 6am, noon, and" " 6pm:

00:00
06:00
12:00
18:00
" ), "reset_times",