Merge pull request #173 from izderadicka/playlist-linux-fix

Playlist ordering and  mime
This commit is contained in:
Igor Katson 2024-08-09 22:00:46 +01:00 committed by GitHub
commit 62067b232f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,7 +152,7 @@ impl HttpApi {
} }
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
playlist_items.sort(); playlist_items.sort_by(|left, right| left.1.cmp(&right.1));
Ok(playlist_items) Ok(playlist_items)
} }
@ -177,10 +177,15 @@ impl HttpApi {
}) })
.join("\r\n"); .join("\r\n");
( (
[( if cfg!(any(target_os = "macos", target_os = "ios")) {
"Content-Type", [(
"application/vnd.apple.mpegurl; charset=utf-8", "Content-Type",
)], "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, body,
) )
} }