Standardized m3u8 formatting

This commit is contained in:
Artrix9095 2024-08-29 14:58:46 -07:00
parent 6ca3561230
commit 0b2a11ec5e

View file

@ -190,6 +190,7 @@ impl HttpApi {
let body = it let body = it
.into_iter() .into_iter()
.map(|(torrent_idx, file_idx, filename)| { .map(|(torrent_idx, file_idx, filename)| {
// TODO: add #EXTINF:{duration} and maybe codecs ?
format!("http://{host}/torrents/{torrent_idx}/stream/{file_idx}/{filename}") format!("http://{host}/torrents/{torrent_idx}/stream/{file_idx}/{filename}")
}) })
.join("\r\n"); .join("\r\n");
@ -201,7 +202,7 @@ impl HttpApi {
"attachment; filename=\"rqbit-playlist.m3u8\"", "attachment; filename=\"rqbit-playlist.m3u8\"",
), ),
], ],
body, format!("#EXTM3U\r\n{body}"), // https://en.wikipedia.org/wiki/M3U
) )
} }