Commit graph

36 commits

Author SHA1 Message Date
Šarūnas Nejus
ab5acaabb3
Reformat all docs using docstrfmt 2025-08-10 16:25:05 +01:00
Max Goltzsche
5d96509cfe
smartplaylist: change encoding of additional field
URL-encode additional item `fields` within generated EXTM3U playlists instead of JSON-encoding them.
This is because JSON-encoding additional fields/attributes made it difficult to parse the `EXTINF` line but using URL-encoding for these values makes parsing easy (because URL-encoded values cannot contain commas, quotation marks and spaces).

I introduced the generation of additional EXTM3U item fields earlier this year and I want to correct that now.

**Design/definition background:**
Unfortunately, I didn't find a clear definition of how additional playlist item attributes should be encoded - apparently there is none.
Given that item URIs within an M3U playlist can be URL-encoded already, defining the values of additional attributes to be URL-encoded is consistent design.
I didn't find examples of additional EXTM3U item attributes in the web where the attribute value contains a comma, space or quotation mark but examples that specified numeric IDs and URLs as attribute values.
Because the URL attribute examples I found didn't contain URL-encoded characters and because it is more readable and unproblematic for parsing, I've let the attribute URL encoding treat `:` and `/` as safe characters.

**Breaking change:**
While this is a breaking change in theory, in practice it is not since afaik all integrations of the smartplaylist plugin's additional EXTM3U item attribute generation feature (beets-webm3u) work with simple attribute values such as the item ID (numeric) whose formatting/encoding is not affected when changing from JSON to URL-encoding.
In other words the change is backward-compatible with the beets-webm3u plugin (which I'll adjust correspondingly after this beets PR was merged).
2025-02-01 01:14:27 +01:00
Max Goltzsche
2821eac973
docs: add smartplaylist example config and m3u 2024-04-20 05:33:20 +02:00
Max Goltzsche
3c6309fe22
docs: mention Beetstream and webrouter plugins
Also, moves the webm3u plugin link from tne interoperability section to the "Other Plugins" section of the documentation.
2024-04-13 04:55:43 +02:00
Max Goltzsche
883bbb3e4b
smartplaylist: rename output format m3u8 to extm3u 2024-04-13 04:55:43 +02:00
Max Goltzsche
c0afd3eb3c
smartplaylist: allow exporting item fields
Allow generating extm3u playlists so that they contain additional item fields such as the `id`.

The feature is required by the mgoltzsche/beets-webm3u plugin (M3U server) to transform playlists using a request based item URI template which may require additional fields such as the `id`, e.g. `beets:library:track;$id`.
2024-04-13 04:55:37 +02:00
Max Goltzsche
58e5b02929
smartplaylist: add --uri-format option
Beets web API already allows remote players to access audio files but it doesn't provide a way to expose the playlists defined using the smartplaylist plugin.
Now the smartplaylist plugin provides an option to generate ID-based item URIs/URLs instead of paths.
Once playlists are generated this way, they can be served using a regular HTTP server such as nginx.

To provide sufficient flexibility for various ways of integrating beets remotely (e.g. beets API, beets API with context path, AURA API, mopidy resource URI, etc), the new option has been defined as a template with an `$id` placeholder (assuming each remote integration requires a different path schema but they all rely on using the beets item `id` as identifier/path segment).

To prevent local path-related plugin configuration from leaking into a HTTP URL-based playlist generation (invoked with CLI option in addition to the local playlists generated into another directory), setting the new option makes the plugin ignore the other path-related options `prefix`, `relative_to`, `forward_slash` and `urlencode`.

Usage examples:
* `beet splupdate --uri-format 'http://beets:8337/item/$id/file'` (for beets web API)
* `beet splupdate --uri-format 'http://beets:8337/aura/tracks/$id/audio'` (for AURA API)

(While it was already possible to generate playlists containing HTTP URLs previously using the `prefix` option, it did not allow to generate ID-based URLs pointing to the beets web API but required to expose the audio files using a web server directly and refer to them using their file system `$path`.)

Relates to #5037
2023-12-16 05:37:27 +01:00
Max Goltzsche
385c05f98e
smartplaylist: change option --extm3u to --output
The boolean flags `--extm3u` and `--no-extm3u` are replaced with a string option `--output=m3u|m3u8`.
This reduces the amount of options and allows to evolve the CLI to support more playlist output formats in the future (e.g. JSON) without polluting the CLI at that point.
2023-12-16 00:23:03 +01:00
Max Goltzsche
222b3a34f9
smartplaylist: expose config as CLI options
Add CLI options to `splupdate` command:
* `--playlist-dir`, `-d`
* `--relative-to`
* `--prefix`
* `--urlencode`
* `--forward-slash`
* `--pretend-paths`
2023-12-15 03:51:27 +01:00
Max Goltzsche
b07a2e42f4
smartplaylist: add extm3u/extinf/m3u8 support
This is to be able to display meaningful metadata and search a playlist within a player without having to load the linked audio files of a playlist.
2023-12-14 01:46:14 +01:00
J0J0 Todos
bcc9c93f97 Add docs for #4573 2022-12-06 07:49:36 +01:00
Kirill A. Korinsky
b0f7418372
Stream-friendly smart playlists
This commit introduced a way to generate a stream-frienldy playlists.
2021-08-14 02:41:22 +02:00
Adrian Sampson
9392256993 Spelling & changelog for #3334 2019-07-24 22:13:53 -04:00
MartyLake
c52973e1c0 Review: Adds missing point to finish sentences 2019-07-24 09:53:54 +02:00
MartyLake
1a4699d0ee Add documentation 2019-07-23 23:46:31 +02:00
FichteFoll
c144141e9a
Update a few more http URLs to https that I missed
Should really be all now (pending the next commit).
2019-06-05 23:07:11 +02:00
Carl Suster
2e0230789f docs: fix some markup issues and typos 2019-04-27 12:43:13 +10:00
Bruno Cauet
86443c076d Document smartplaylist sorting behavior. 2015-03-18 19:05:16 +01:00
Bruno Cauet
5d1ee0457f Document the smartplaylist plugin updates 2015-03-16 18:47:38 +01:00
Bruno Cauet
82772966c8 Smartplaylist: fix incorrect doc
With auto mode playlists are regenerated *at the end of the session, if
a database update happened*, and not after a database update.
2015-01-13 11:53:39 +01:00
Fabrice Laporte
f7ecb9cbae doc: emphasize options names by using bold font instead of fixed width 2014-11-07 22:13:25 +01:00
Adrian Sampson
930581ac99 Finish the pass over all plugin docs 2014-10-30 22:42:11 -07:00
Fabrice Laporte
b922abef06 docs: remove space before colon 2014-10-28 23:23:44 +01:00
Fabrice Laporte
2cd76b6714 docs: add plugin name in "how to configure" sentences 2014-10-28 23:23:10 +01:00
Fabrice Laporte
cb350de2ea harmonize all plugins docs
Add a configuration section that lists all options for each plugin.
List options in alphabetic order.
Mention the default value for each option.
Use same sentences to describe concepts common to different plugins eg 'auto
option, install description
2014-10-26 22:29:10 +01:00
Johannes
2eadd9e3de Update MPD links in docs 2014-04-07 18:04:15 +01:00
Bruno Tournay
33632e0caf We can now disable auto regeneration of smartplaylist 2014-03-09 22:57:07 +01:00
Bruno Tournay
05d54b4f23 Added ability to also include in playlist result from query based on albums (album_query parameter). 2014-03-08 21:24:56 +01:00
Adrian Sampson
f06a16819f spl mutli-query (#575): remove option, changelog 2014-03-07 14:26:49 -08:00
Bruno Tournay
ab513f7bc2 Add the ability to gather the result of ^Cveral queries into a smartplaylist 2014-03-05 21:40:24 +01:00
Adrian Sampson
bf904187e2 smartplaylist: split query w/ shlex (fixes #256) 2013-04-21 20:55:07 -07:00
Adrian Sampson
c706c1f15a changelog entry / tiny doc tweaks for #90 2013-02-03 10:31:15 -08:00
Dang Mai
24bc084724 Add small docs for smartplaylist about chaining 2013-02-03 10:10:29 -05:00
Adrian Sampson
bba0051ee7 changelog & doc tweaks for smartplaylist (#80) 2013-01-31 10:07:18 -08:00
Dang Mai
89b19f3e67 Documentation about template in m3u names 2013-01-30 12:47:44 -05:00
Dang Mai
f4107703fb Add documentation for plugin 2013-01-30 09:30:36 -05:00