From b38c371d3f5070969757c60cf63b993cca9b84ea Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 9 Aug 2024 21:38:31 +0200 Subject: [PATCH 1/2] Playlist ordering and mime --- crates/librqbit/src/http_api.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/librqbit/src/http_api.rs b/crates/librqbit/src/http_api.rs index 3fee0561..1034706c 100644 --- a/crates/librqbit/src/http_api.rs +++ b/crates/librqbit/src/http_api.rs @@ -152,7 +152,7 @@ impl HttpApi { } }) .collect::>(); - playlist_items.sort(); + playlist_items.sort_by(|left, right| left.1.cmp(&right.1)); Ok(playlist_items) } @@ -177,10 +177,14 @@ impl HttpApi { }) .join("\r\n"); ( - [( - "Content-Type", - "application/vnd.apple.mpegurl; charset=utf-8", - )], + if cfg!(any(target_os = "macos", target_os = "ios")) { + [( + "Content-Type", + "application/vnd.apple.mpegurl; charset=utf-8", + )] + } else { + [("Content-Type", "text/plain; charset=utf-8")] + }, body, ) } From ff190e307060a42d6a1a17ae335d291f802618f2 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 9 Aug 2024 22:15:16 +0200 Subject: [PATCH 2/2] Add comment --- crates/librqbit/src/http_api.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/librqbit/src/http_api.rs b/crates/librqbit/src/http_api.rs index 1034706c..e9dfd714 100644 --- a/crates/librqbit/src/http_api.rs +++ b/crates/librqbit/src/http_api.rs @@ -183,6 +183,7 @@ impl HttpApi { "application/vnd.apple.mpegurl; charset=utf-8", )] } else { + // apple mime does not work with VLC on linux [("Content-Type", "text/plain; charset=utf-8")] }, body,