Skip to main content

render_m3u8

Function render_m3u8 

Source
pub fn render_m3u8(name: &str, entries: &[M3u8Entry<'_>]) -> String
Expand description

Render an extended-M3U8 playlist named name from entries, preserving their order.

The output opens with the #EXTM3U header and a #PLAYLIST:<name> line, then per entry emits either an #EXTINF:<seconds>,<title> line followed by the relative path line (a member present in the library), or a # (not in library) <title> comment line (an M3u8Entry with an empty relative path — HARDENING L1). Seconds are rounded to the nearest whole number. Carriage returns and line feeds in the name, title, and path are folded to spaces so a single field can never break the line structure.