Merge pull request #229 from Artrix9095/main

Standardized m3u8 formatting
This commit is contained in:
Igor Katson 2024-08-29 23:22:28 +01:00 • committed by GitHub
commit 0b248a93e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
) )
} }