Skip to content

mgoltzsche/beets-websearch

Repository files navigation

beets-websearch

A beets plugin to search tracks and save the result as playlists via HTTP.

Features

  • Provides a JSON REST API to search tracks.
  • Allows to save searches as playlists.

Installation

python3 -m pip install beets-websearch

Configuration

Enable the plugin and add a websearch section to your beets config.yaml as follows:

plugins:
  - websearch

websearch
  host: '127.0.0.1'
  port: 5000

Usage

Once the websearch plugin is enabled within your beets configuration, you can run it as follows:

beet websearch

You can browse the server at http://127.0.0.1:5000.

To serve multiple beets web APIs using a single process, you can use the webrouter plugin.

CLI

Usage: beet websearch [options]

Options:
  -h, --help   show this help message and exit
  -d, --debug  debug mode

Web API

See OpenAPI definition.

Development

The following assumes you have docker installed.

In case you make changes to the openapi.yaml, you can validate them as follows:

make validate-openapi

Generate the server stub from the openapi.yaml (containerized):

make generate

Run the unit tests (containerized):

make test

Run the e2e tests (containerized):

make test-e2e

To test your plugin changes manually, you can run a shell within a beets docker container as follows:

make beets-sh

A temporary beets library is written to ./data. It can be removed by calling make clean-data.

To download example data, run:

make example-data

To just start the server, run:

make beets-websearch

Now you can browse the executable API documentation at http://127.0.0.1:5000/docs.

Example API call to search tracks: http://127.0.0.1:5000/tracks?query={%22artist%22:{%22contains%22:%20%22dengue%22},%22title%22:{%22contains%22:%22serpiente%22}}.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published