tonhowtf/omniget · warning

[omnidisc] media capabilities unavailable

Error message

[omnidisc] media capabilities unavailable

What it means

refreshMediaCapabilities calls the Tauri backend command `omnidisc_media_capabilities` via invoke(). When the backend command rejects or is missing, the promise rejects and the store logs this warning, leaving `capabilities` unset (null/stale). It is deliberately non-fatal: the app keeps running with degraded media-capability knowledge.

Solutions

  1. Rebuild/restart the Rust backend so the `omnidisc_media_capabilities` command is registered and matches the frontend's expected MediaCapabilities shape.
  2. Check the Rust command name and#[tauri::command] registration in the invoke_handler list for typos.
  3. Verify serde field names on the Rust MediaCapabilities struct match the TypeScript type exactly (camelCase vs snake_case).
  4. Handle the null/stale capabilities downstream (check isStreamer/capabilities before assuming codec support).

Example fix

// before
capabilities = await invoke<MediaCapabilities>("omnidisc_media_capabilities");
// after
capabilities = await invoke<MediaCapabilities>("omnidisc_media_capabilities") ?? DEFAULT_CAPABILITIES;
Defensive patterns

Strategy: fallback

Validate before calling

if (!('__TAURI_INTERNALS__' in window)) { console.warn('not in Tauri runtime; skipping media capabilities'); }

Type guard

function hasCapabilities(c: unknown): c is MediaCapabilities {
  return typeof c === 'object' && c !== null;
}

Try / catch

let capabilities: MediaCapabilities | null = null;
try {
  capabilities = await invoke<MediaCapabilities>("omnidisc_media_capabilities");
} catch (e) {
  capabilities = DEFAULT_CAPABILITIES; // safe fallback
}

Prevention

When it happens

Trigger: Calling initStream()/refreshMediaCapabilities() when the Rust command `omnidisc_media_capabilities` is not registered, panics, or returns a serialization-incompatible value (e.g. the webview runs against an older backend build without the command).

Common situations: Running a frontend dev build against a stale Rust binary that lacks the omnidisc media command; backend panic while probing hardware codecs; MediaCapabilities struct fields renamed on the Rust side so serde deserialization fails.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/b738c7a37e4bafb0. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/stores/omnidisc-stream-store.svelte.ts:166

}

export function getStreamError(): string | null {
  return lastError;
}

export function clearStreamError() {
  lastError = null;
}

export function getMediaCapabilities(): MediaCapabilities {
  return capabilities;
}

export async function refreshMediaCapabilities(): Promise<void> {
  try {
    capabilities = await invoke<MediaCapabilities>("omnidisc_media_capabilities");
  } catch (e) {
    console.warn("[omnidisc] media capabilities unavailable", errorText(e));
  }
}

export function isStreamer(userId: string): boolean {
  return streamers[userId] === true;
}

export function getStreamerIds(): string[] {
  return Object.keys(streamers).filter((id) => streamers[id]);
}

export function getStreamPreview(): string | null {
  return previewImage;
}

export function markStreamer(userId: string, on: boolean) {
  if (streamers[userId] === on) return;
  streamers = { ...streamers, [userId]: on };

View on GitHub (pinned to 8600b91f42)