Module playlist

Source
Expand description

M3U playlists: the one place that knows how to write one.

Two callers with two purposes. --m3u hands whatever is on screen to a player, so it writes absolute paths to a file that may end up anywhere. aede playlist writes into the album folder itself, so it writes relative ones: a playlist beside its music travels with it, survives the folder being moved or copied to a card, and is the same file on another machine. One renderer for both, because two would agree about #EXTINF today and disagree about it in six months.

Modules§

files
Bounded, read-only discovery of playlist files under watched roots. Filesystem playlists are shared library files, independent of private exports.
folders
Shared catalog-derived folder destinations and rendering. Shared album/discography destinations for the CLI and explicit server publication.
selection
Explicit catalog-only resolution of existing M3U entries. Resolve inert playlist entries against catalog identities, without entry I/O.

Enums§

Style
Which of the two M3U dialects to write.

Functions§

already_says
true when the file already holds exactly this, byte for byte.
entry_lines
M3U entries with their zero-based source line numbers, without trimming paths.
file_name
The name of the playlist a folder should hold: the folder’s own name.
read_text
Read local playlist text, refusing input larger than 16 MiB.
render
Renders a playlist.
try_render
Renders a complete selection, refusing paths M3U cannot represent.
write_atomic
Replaces a playlist only after its complete text has been written.