MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _resolve_output_format

Function _resolve_output_format

apps/proxy/live_proxy/views.py:56–76  ·  view source on GitHub ↗

Return the output format string to use for this client.

(user, force=None, request=None)

Source from the content-addressed store, hash-verified

54
55
56def _resolve_output_format(user, force=None, request=None):
57 """Return the output format string to use for this client."""
58 _FORMAT_ALIASES = {
59 'mpegts': 'mpegts',
60 'ts': 'mpegts',
61 'fmp4': 'fmp4',
62 'mp4': 'fmp4',
63 }
64 if force:
65 return force
66 if request:
67 # Support both ?output_format= (native) and ?output= (XC-style)
68 param = request.GET.get('output_format') or request.GET.get('output')
69 if param in _FORMAT_ALIASES:
70 return _FORMAT_ALIASES[param]
71 if user:
72 custom = getattr(user, 'custom_properties', None) or {}
73 user_format = custom.get('output_format')
74 if user_format:
75 return user_format
76 return CoreSettings.get_default_output_format()
77
78
79def _resolve_output_profile(request, user):

Callers 1

stream_tsFunction · 0.85

Calls 2

getMethod · 0.45

Tested by

no test coverage detected