MCPcopy Index your code

hub / github.com/Screenly/Anthias / functions

Functions1,832 in github.com/Screenly/Anthias

↓ 5 callersFunction_write_timezone
(tmp_path: Path, value: str)
tests/test_django_timezone.py:17
↓ 5 callersFunction_zoneinfo_root
(tmp_path: Path, *zone_files: str)
tests/test_django_timezone.py:23
↓ 5 callersFunctionbuild_imager_json
()
tools/raspberry_pi_imager/build_pi_imager_json.py:140
↓ 5 callersFunctionclamp_refresh_interval
Coerce an arbitrary ``metadata['refresh_interval_s']`` value to a safe int in ``[0, REFRESH_INTERVAL_S_MAX]``. The serializer's write path re
src/anthias_server/app/models.py:22
↓ 5 callersFunctioncompute_fit_dims
Aspect-fit ``src`` into ``fb``, honouring the source PAR. Returns the largest WxH that fits inside the framebuffer while preserving the sourc
src/anthias_viewer/gst_fbdev_player.py:81
↓ 5 callersFunctiondetect_total_mem_kb
Return the host's ``MemTotal`` (kibibytes) from ``/proc/meminfo``. Anthias's codec gate uses this to refuse 1080p+ uploads on devices that ca
src/anthias_host_agent/__main__.py:154
↓ 5 callersFunctiondispatch_download
Queue the Celery worker to fetch *source_uri* into the row. Lazy import keeps the celery_tasks module out of import paths that don't need it
src/anthias_common/youtube.py:73
↓ 5 callersFunctiondispatch_normalize_video
Queue ``normalize_video_asset`` for the just-persisted row. See ``dispatch_normalize_image`` for the metadata stamp rationale.
src/anthias_server/processing.py:204
↓ 5 callersFunctionfake_settings
(raw: str)
tests/test_settings.py:59
↓ 5 callersFunctionget_anthias_release
Read the project version, sourced from pyproject.toml's [project].version (currently CalVer ``YYYY.M.MICRO``). Resolution order: 1. ``i
src/anthias_common/version.py:14
↓ 5 callersFunctionget_asset_list
(release_tag: str)
tools/raspberry_pi_imager/build_pi_imager_json.py:98
↓ 5 callersFunctionload_browser
Launch AnthiasViewer, retrying the spawn past the flaky init crash. Defaults use the generous startup budget. Mid-playback respawns (view_ima
src/anthias_viewer/__init__.py:721
↓ 5 callersFunctionnormalize_os
balenaOS 6.1.24+rev4' -> '6.1.24+rev4' (the form resinhup wants).
bin/balena_unpin_devices.py:225
↓ 5 callersFunctionrun_balena
Run a balena CLI command. Returns (ok, stdout, stderr). balena prints Node/CLI warnings to stderr, so stdout stays clean for --json parsing.
bin/balena_fleet_maintenance.py:67
↓ 5 callersFunctionrun_migrate
(user_home: str)
tests/test_migrate_legacy_paths.py:16
↓ 5 callersFunctionsave_active_assets_ordering
(active_asset_ids: list[str])
src/anthias_server/api/helpers.py:69
↓ 5 callersFunctionschedule_window
Return a structured descriptor for the asset's start/end window. Renders as a single visual block in the schedule table — primary line is a r
src/anthias_server/app/templatetags/asset_filters.py:213
↓ 5 callersMethodsend
(self, correlation_id: str, msg: Any)
src/anthias_server/settings.py:208
↓ 5 callersFunctionstamp_processing_start
Mark ``metadata['processing_started_at']`` to the current UTC. Read by the periodic reconciler (``reconcile_stuck_processing``) to age rows t
src/anthias_server/processing.py:133
↓ 5 callersFunctionstring_to_bool
(string: Any)
src/anthias_common/utils.py:54
↓ 5 callersFunctionview
(request: HttpRequest)
tests/test_views_files.py:68
↓ 4 callersFunction_auth_headers
(token: str)
src/anthias_server/lib/screenly_migration.py:76
↓ 4 callersFunction_enable_auth
Patch the global settings dict so @authorized treats auth as enabled. Returns a ``patch.dict`` context manager — use as ``with _enable_auth():
tests/test_auth.py:722
↓ 4 callersFunction_ext
Lowercase trailing extension *with* the dot, or ``''``. Used to decide passthrough/transcode for video. ``os.path.splitext`` returns the empt
src/anthias_server/processing.py:263
↓ 4 callersFunction_parse_local_datetime
Parse a date/time the edit-form posts back from Flatpickr. Flatpickr formats the value using whatever format we asked for (m/d/Y h:i K, d-m-Y
src/anthias_server/app/views.py:63
↓ 4 callersFunction_parse_local_time
Parse a time-of-day the edit-form posts back from Flatpickr. The Play from / Play until pickers format with 'H:i' when the 24-hour clock is o
src/anthias_server/app/views.py:96
↓ 4 callersMethod_patch_executor
(self)
tests/test_celery_tasks.py:1933
↓ 4 callersFunction_rotation_value
Coerce settings['screen_rotation'] to a known cardinal angle. Thin wrapper around the shared clamp_screen_rotation() helper — keeps the viewe
src/anthias_viewer/__init__.py:116
↓ 4 callersFunction_safe_local_asset_path
Resolve uri to a real path under settings['assetdir']. Mirrors the realpath + startswith guard that views_files.anthias_assets uses for the p
src/anthias_server/app/views.py:1077
↓ 4 callersMethod_scantree_tolerant
``whitenoise.base.scantree``, but a directory that can't be listed or an entry that can't be stat'd is recorded in ``skipped`` instead
src/anthias_server/lib/whitenoise.py:70
↓ 4 callersFunction_set_github_error_backoff
(action: str)
src/anthias_server/lib/github.py:39
↓ 4 callersFunction_set_processing_error
Persist a human-readable error and clear is_processing. Both tasks land here on a permanent failure (corrupt HEIC, truncated TIFF, ffmpeg ref
src/anthias_server/processing.py:322
↓ 4 callersFunctionbuild_fit_caps_string
Caps for the post-convert capsfilter. Without dims (pre-probe) only the framebuffer pixel format and a square PAR are pinned — enough for the
src/anthias_viewer/gst_fbdev_player.py:121
↓ 4 callersFunctiondetect_board_subtype
Identify a non-Pi SBC by reading ``/proc/device-tree/model``. Returns a stable short token (e.g. ``'rockpi4'``) when the model string matches
src/anthias_common/device_helper.py:149
↓ 4 callersFunctiondispatch_pending_normalize
Branch on ``serializer._pending_normalize`` and dispatch. Single hand-off point shared by every API version's create view (v1 / v1.1 / v1.2 /
src/anthias_server/processing.py:215
↓ 4 callersFunctionget_anthias_product_token
Return the ``Anthias/<release>`` product token. Single source of truth for the ``Anthias/<version>`` label. Shared by :func:`get_user_agent`
src/anthias_common/http.py:23
↓ 4 callersFunctionget_balena_supervisor_api_response
Call the Balena supervisor API. Extra kwargs (e.g. ``timeout``, ``allow_redirects``) are forwarded to ``requests.get`` / ``requests.post``. E
src/anthias_common/utils.py:103
↓ 4 callersFunctionget_board_subtype
Return the board subtype, or ``None``. Redis (the host_agent-published value) is authoritative when present. When it yields nothing — key mis
src/anthias_common/board.py:43
↓ 4 callersMethodget_db_mtime
(self)
src/anthias_viewer/scheduling.py:232
↓ 4 callersFunctionget_video_duration
Returns the duration of a video file in timedelta. Returns None if ffprobe is not available on the host so callers can surface a clean v
src/anthias_common/utils.py:500
↓ 4 callersFunctioninternal_auth_token
Derive the internal API token shared by server and viewer.
src/anthias_common/internal_auth.py:20
↓ 4 callersFunctionis_keep_pinned
(device: dict[str, Any])
bin/balena_unpin_devices.py:298
↓ 4 callersFunctionis_youtube_url
True when *uri* points at a recognised YouTube hostname. Substring sniffing (`'youtube' in uri`) was rejected: it would match decoy hosts lik
src/anthias_common/youtube.py:33
↓ 4 callersFunctionmarketing_screenshot
Capture ``page`` at the context's scale factor and emit a ``<name>.png`` plus retina ``<name>@2x.png`` and ``<name>@3x.png`` siblings under ``
tests/conftest.py:383
↓ 4 callersFunctionnotify_asset_update
Fan-out a 'refresh' nudge to every connected browser. Sync wrapper around channels.layers.group_send so Django views and Celery tasks can fir
src/anthias_server/app/consumers.py:28
↓ 4 callersFunctionoperator_username
Best-effort username of the device's operator account. Used by the settings page (to pre-fill the username input) and the /api/v2/device-sett
src/anthias_server/lib/auth.py:754
↓ 4 callersFunctionparse_request
(request: Any)
src/anthias_server/api/helpers.py:100
↓ 4 callersMethodpush
(kind: ToastItem['kind'], message: string, ttlMs?: number)
src/anthias_server/app/static/src/vendor.ts:41
↓ 4 callersMethodput
(self, request: Request, asset_id: str)
src/anthias_server/api/views/v2.py:476
↓ 4 callersMethodrefresh_playlist
(self)
src/anthias_viewer/scheduling.py:170
↓ 4 callersFunctionset_board_subtype
Publish the host's board subtype to Redis. Server + viewer read ``host:board_subtype`` to upgrade the catch-all ``arm64`` DEVICE_TYPE into a
src/anthias_host_agent/__main__.py:211
↓ 4 callersFunctiontemplate_handle_unicode
(value: Any)
src/anthias_common/utils.py:625
↓ 4 callersFunctionvalidate_url
Simple URL verification. >>> validate_url("hello") False >>> validate_url("ftp://example.com") False >>> validate_url("http://")
src/anthias_common/utils.py:77
↓ 4 callersFunctionyoutube_destination_path
Resolve where the downloaded mp4 will land. Picks ``settings['assetdir']`` so ``cleanup()`` (which sweeps that same directory) recognises the
src/anthias_common/youtube.py:53
↓ 3 callersFunction_apply_wlr_transform
Push the requested transform to every wlroots output. Returns: * True on non-Wayland boards (no-op — the linuxfb path handles r
src/anthias_viewer/__init__.py:323
↓ 3 callersFunction_args
(rotation: int = 0)
tests/test_gst_fbdev_player.py:83
↓ 3 callersFunction_call_anthias_assets
( factory: RequestFactory, filename: str, remote_addr: str, )
tests/test_views_files.py:133
↓ 3 callersFunction_conf_get
Trim helper around configparser — returns '' when the section or key doesn't exist.
src/anthias_server/app/migrations/0005_migrate_basic_auth_to_user.py:65
↓ 3 callersFunction_drop_image_staging
()
src/anthias_server/processing.py:605
↓ 3 callersFunction_load_bar
(value: float)
src/anthias_server/app/page_context.py:109
↓ 3 callersFunction_make_video
Synthesise a tiny clip with a chosen codec / container / audio. Why ffmpeg instead of a binary fixture: the matrix of codecs the task branche
tests/test_processing.py:169
↓ 3 callersFunction_maybe_screenshot
No-op unless PYTEST_CAPTURE_SCREENSHOTS is set in the env.
tests/test_app.py:1891
↓ 3 callersFunction_parse_version
Parse a CalVer string, tolerating the conventional leading ``v`` on git tags (``v2026.5.0``).
src/anthias_server/lib/github.py:125
↓ 3 callersFunction_pluralize
(count: int, suffix: str = 's')
src/anthias_server/app/views.py:752
↓ 3 callersFunction_safe_ext
(candidate: str)
src/anthias_server/app/views.py:464
↓ 3 callersFunction_safe_redirect_uri
Defang asset.uri before handing it to redirect(). Threat model: the asset row is operator-controlled (authenticated session, gated by @author
src/anthias_server/app/views.py:1037
↓ 3 callersFunction_save_settings_form
(page: Page)
tests/test_app.py:1490
↓ 3 callersFunction_send_to_webview
Run a ``browser_bus`` call, respawning the webview if it died mid-call. The flaky armv7 Qt5 init crash that load_browser() retries past can
src/anthias_viewer/__init__.py:885
↓ 3 callersFunction_set_flatpickr_time
Drive a Flatpickr time picker the way an operator does: click the input so the picker pops open, type into its hour/minute spinners, click the
tests/test_app.py:1070
↓ 3 callersFunction_stage_temp_upload
Mirror ``FileAssetViewMixin.post`` byte-for-byte: write ``<assetdir>/<uuid>.tmp`` and return the path. Used by the upload-path wiring tests to
tests/test_processing.py:2153
↓ 3 callersFunction_stub_browser_stdout_chunks
As above, but advance through `chunks` across reads — for the success case where the handshake appears in a later poll.
tests/test_viewer.py:185
↓ 3 callersFunction_terminate_webview
Best-effort: stop an AnthiasViewer process and confirm it's gone. SIGTERM, wait up to ``BROWSER_TERMINATE_GRACE_SECONDS``, then SIGKILL if st
src/anthias_viewer/__init__.py:574
↓ 3 callersMethod_url_asset
(self)
src/anthias_server/api/tests/test_screenly_migration.py:283
↓ 3 callersFunction_with_fresh_window
Return a copy of ``seed`` with ``start_date`` / ``end_date`` recomputed against current wall-clock. The module-level seed singletons freeze th
tests/_seed_data.py:114
↓ 3 callersFunctionbackup_archive_name
(name: str = default_archive_name)
src/anthias_server/lib/backup_helper.py:75
↓ 3 callersFunctionbuild_and_start
Build a fresh playbin and set it PLAYING. Always a fresh element: a playbin whose sink activation failed (or that posted an ERROR) do
src/anthias_viewer/gst_fbdev_player.py:311
↓ 3 callersFunctionbuild_sink_description
gst-parse description for playbin's ``video-sink`` bin. ``videorate`` caps the frame rate (drop-only — never duplicates), ``videoflip`` is in
src/anthias_viewer/gst_fbdev_player.py:188
↓ 3 callersFunctionclear_framebuffer
Zero the visible framebuffer (black) — best-effort. Letterbox borders around an aspect-fit video are simply regions fbdevsink never touches,
src/anthias_viewer/gst_fbdev_player.py:140
↓ 3 callersMethodconnect
(self)
src/anthias_server/app/consumers.py:14
↓ 3 callersFunctiondelete_asset_with_file
Delete an ``Asset`` row, remove its on-disk file (if owned), and nudge the viewer to advance past it. Shared by the v1/v1.1/v1.2/v2 API delet
src/anthias_server/app/helpers.py:119
↓ 3 callersFunctiondispatch_normalize_image
Queue ``normalize_image_asset`` for the just-persisted row. Lazy import of ``anthias_server.celery_tasks`` keeps this module importable from
src/anthias_server/processing.py:186
↓ 3 callersMethodget
( self, request: HttpRequest, *args: Any, **kwargs: Any, )
src/anthias_server/django_project/urls.py:30
↓ 3 callersMethodget
(self, request: Request)
src/anthias_server/api/views/mixins.py:406
↓ 3 callersFunctionget_active_asset_ids
()
src/anthias_server/api/helpers.py:60
↓ 3 callersFunctionget_board_model
Host board model from the device tree, '' when unavailable. ``/proc/device-tree`` resolves to ``/sys/firmware/devicetree/base``, which Docker
src/anthias_server/django_project/settings.py:217
↓ 3 callersFunctionget_github_headers
()
tools/raspberry_pi_imager/build_pi_imager_json.py:65
↓ 3 callersMethodget_uptime
(self)
src/anthias_server/api/views/v2.py:897
↓ 3 callersFunctionhandler
(obj: Any)
src/anthias_common/utils.py:532
↓ 3 callersFunctionis_ci
Returns True when run on CI.
src/anthias_common/utils.py:70
↓ 3 callersFunctionis_internal_request
(request: Any, settings: Mapping[str, Any])
src/anthias_common/internal_auth.py:32
↓ 3 callersFunctionis_streaming_uri
True when *uri* is a live stream the viewer plays directly via its video pipeline rather than a downloadable file or a renderable web page.
src/anthias_common/remote_video.py:213
↓ 3 callersFunctionis_up_to_date
Return ``True`` if this device is on (or ahead of) the latest published Anthias release. Compares ``importlib.metadata.version('anthias')`` (
src/anthias_server/lib/github.py:150
↓ 3 callersFunctionpinned_filter
(fleet: str, exclude_kept: bool)
bin/balena_unpin_devices.py:235
↓ 3 callersMethodprepare_asset
(self, data: dict[str, Any])
src/anthias_server/api/serializers/v1_1.py:71
↓ 3 callersFunctionprobe_video_duration
Resolve a freshly uploaded video's length out of band. The HTML upload view returns the table partial as soon as the bytes are written so the
src/anthias_server/celery_tasks.py:472
↓ 3 callersMethodpush
(kind: 'success' | 'error' | 'info', message: string)
src/anthias_server/app/static/src/home.ts:38
↓ 3 callersFunctionremote_video_destination_path
Resolve where the downloaded file will land on disk. Mirrors ``anthias_common.youtube.youtube_destination_path`` but takes the extension as a
src/anthias_common/remote_video.py:245
↓ 3 callersFunctionsetActive
(index: number)
website/assets/js/slider.ts:101
↓ 3 callersFunctionset_total_mem_kb
Publish the host's MemTotal (kibibytes) to Redis. Written before ``host_agent_ready`` flips so a consumer waiting on readiness never observes
src/anthias_host_agent/__main__.py:190
↓ 3 callersFunctionskip_asset
(scheduler: Any, back: bool = False)
src/anthias_viewer/playback.py:8
← previousnext →101–200 of 1,832, ranked by callers