Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-media-provider-local

OVOS MediaProvider plugin for a local file-system media library.

Given a parsed media request, it searches one or more configured directories on disk and returns ranked, playable mediavocab.Release objects with file:// uris. Instead of a fixed set of MediaType subfolders and a bus listener, this provider is loaded in-process by the OCP pipeline and its search() is called directly. It supersedes the catalog/search half of the legacy OCP skill ovos-skill-local-media.

Routing

Axis Value
media MUSIC, MOVIE
playback_type AUDIO, VIDEO
genre_filter (none)

Install

pip install ovos-media-provider-local

Configure

Per-provider settings live under media_providers in mycroft.conf, keyed by the provider's entry-point name:

{
  "media_providers": {
    "local": {
      "paths": ["~/Music", "~/Videos", "/mnt/media"],
      "max_results": 10,
      "min_confidence": 0.3
    }
  }
}
Key Default Description
paths $XDG_MUSIC_DIR/~/Music, $XDG_VIDEOS_DIR/~/Videos Directories scanned recursively for media files.
max_results 10 Maximum number of matching files returned per search.
min_confidence 0.3 Files scoring below this are dropped from the results.

Set "enabled": false to disable without uninstalling.

How it works

Every audio/video file under a configured path is indexed once and re-used across searches; the index is rebuilt on the next search() call only for files whose mtime changed or that are new, and entries for files that disappeared are dropped. There is no background thread — the refresh runs synchronously at the start of search().

Tags are read with tinytag where the format supports it (title/artist/album/genre/duration). A file with no readable tags falls back to a title derived from its filename. search() scores each candidate with fuzzy_match against the query title, with a bonus when the requested artist is tagged on the file; a bare browse request (no title, no artist) returns the whole library at a flat low confidence instead of favouring one arbitrary file.

Related projects

Docs

Tests

pip install -e .[test]
pytest test/

Tests use real fixture files generated under tmp_path (a tag-less WAV built with the stdlib wave module, plus a tiny tagged MP3 synthesized with ffmpeg where available). Tests that need the tagged MP3 are skipped, not failed, when ffmpeg is not on PATH.

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_media_provider_local-0.0.1a5.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_media_provider_local-0.0.1a5-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file ovos_media_provider_local-0.0.1a5.tar.gz.

File metadata

File hashes

Hashes for ovos_media_provider_local-0.0.1a5.tar.gz
Algorithm Hash digest
SHA256 590efea4dca8def49940bc481cf8bf3ab4577989a104e9f196ed4892b2886f78
MD5 51185ecdfcbe3c75a60b786591623235
BLAKE2b-256 a5533e9bc314e0816dbd541b12975d7b27c9781f98596589e5e8e4fc75f8490f

See more details on using hashes here.

File details

Details for the file ovos_media_provider_local-0.0.1a5-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_media_provider_local-0.0.1a5-py3-none-any.whl
Algorithm Hash digest
SHA256 7b33db33222797dac63ce64d5268b6a45fe0b052d1298e425d77d961ca328f34
MD5 f7b02b48116000d7e7dd3aea08eeffe0
BLAKE2b-256 dbd229dc132e5114f6d5982dc118524e8d737ee17a909593f0a78bb2213b6acd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1a5 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page