Metadata-Version: 2.4
Name: ovos-media-provider-somafm
Version: 0.0.1a4
Summary: OVOS MediaProvider plugin for SomaFM (replaces ovos-skill-somafm)
Author-email: JarbasAI <jarbasai@mailfence.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/OpenVoiceOS/ovos-media-provider-somafm
Project-URL: Source, https://github.com/OpenVoiceOS/ovos-media-provider-somafm
Keywords: ovos,OpenVoiceOS,OCP,media,radio,somafm,MediaProvider
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mediavocab>=1.0.0
Requires-Dist: ovos-plugin-manager<3.0.0,>=2.8.0a1
Requires-Dist: radiosoma>=0.0.2a2
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# ovos-media-provider-somafm

OVOS **MediaProvider** plugin for [SomaFM](https://somafm.com). It replaces
the deprecated OCP search skill
[`ovos-skill-somafm`](https://github.com/OpenVoiceOS/ovos-skill-somafm).

Instead of broadcasting `ovos.common_play.query` over the bus and waiting for
skills to answer, the OCP pipeline loads MediaProvider plugins in-process,
gates them by routing, and calls `search()` directly. This plugin wraps the
[`radiosoma`](https://github.com/TigreGotico/radiosoma) client. Its
`converters.station_to_releases` function maps each SomaFM channel into
[`mediavocab.Release`](https://github.com/TigreGotico/mediavocab) objects, one
per stream encoding.

SomaFM is a fixed, curated channel list, so `search()` is a local filter over
the station catalog. It matches `signals.title` against the channel name and
description, and `signals.content_genres` against the channel genre tags.

## Install

```bash
pip install ovos-media-provider-somafm
```

## Usage

The OCP pipeline discovers and loads this plugin through its entry point. To
call it directly:

```python
from mediavocab import Signals
from ovos_media_provider_somafm import SomaFMMediaProvider

provider = SomaFMMediaProvider()
releases = provider.search(Signals(title="deep space"))
```

A query with neither `title` nor `content_genres` set matches every station,
so a bare `RADIO` request browses the whole catalog.

## Routing

| Axis | Value |
|------|-------|
| `media` | `RADIO` |
| `playback_type` | `AUDIO` |
| `genre_filter` | *(none)* |

## Entry point

```toml
[project.entry-points."opm.media.provider"]
somafm = "ovos_media_provider_somafm:SomaFMMediaProvider"
```

## Configuration

| Key | Default | Description |
|-----|---------|-------------|
| `max_results` | `10` | Maximum number of matching channels returned per search. |

## Related projects

- [`ovos-plugin-manager`](https://github.com/OpenVoiceOS/ovos-plugin-manager): defines the `MediaProvider` template this plugin implements.
- [`radiosoma`](https://github.com/TigreGotico/radiosoma): the SomaFM API client this plugin wraps.
- [`mediavocab`](https://github.com/TigreGotico/mediavocab): the `Release`/`Signals` vocabulary used to describe search queries and results.
- [`ovos-skill-somafm`](https://github.com/OpenVoiceOS/ovos-skill-somafm): the deprecated OCP search skill this plugin replaces.

## License

Apache-2.0
