mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-22 01:30:15 +00:00
feat(catchup): enhance catchup functionality with user and system settings
This update introduces a new `is_catchup_enabled` function to determine if catch-up is allowed for users based on their custom properties and system settings. The `UserViewSet` is modified to restrict admin-managed properties, including catch-up access. Additionally, various views and tests are updated to incorporate catch-up checks, ensuring that users without access receive appropriate error responses. The frontend is enhanced with a catch-up toggle in user and system settings forms, allowing for better management of catch-up capabilities.
This commit is contained in:
parent
2b62928b42
commit
b6442e6421
23 changed files with 549 additions and 106 deletions
|
|
@ -16,11 +16,19 @@ class BaseConfig:
|
|||
BUFFERING_TIMEOUT = 15 # Seconds to wait for buffering before switching streams
|
||||
BUFFER_SPEED = 1 # What speed to condsider the stream buffering, 1x is normal speed, 2x is double speed, etc.
|
||||
|
||||
# Cache for proxy settings (class-level, shared across all instances)
|
||||
# Cache for proxy settings (class-level, shared across all instances).
|
||||
# Backed by CoreSettings Redis group cache; this local copy avoids Redis
|
||||
# chatter inside the proxy hot path. Cleared when proxy_settings is saved.
|
||||
_proxy_settings_cache = None
|
||||
_proxy_settings_cache_time = 0
|
||||
_proxy_settings_cache_ttl = 10 # Cache for 10 seconds
|
||||
|
||||
@classmethod
|
||||
def clear_proxy_settings_cache(cls):
|
||||
"""Drop process-local proxy settings (called on CoreSettings invalidate)."""
|
||||
cls._proxy_settings_cache = None
|
||||
cls._proxy_settings_cache_time = 0
|
||||
|
||||
@classmethod
|
||||
def get_proxy_settings(cls):
|
||||
"""Get proxy settings from CoreSettings JSON data with fallback to defaults (cached)"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue