Integrate local movie file into playlist

This commit is contained in:
euzu
2025-12-16 20:35:19 +01:00
parent 5f9fa8ea56
commit c8d34e0dfd
7 changed files with 38 additions and 23 deletions
+6 -3
View File
@@ -1051,9 +1051,12 @@ pub async fn local_stream_response(
.and_then(|v| v.to_str().ok())
.and_then(parse_range);
let (start, end) = if let Some((start, end)) = range {
let end = end.unwrap_or(file_size - 1);
(start, end.min(file_size - 1))
let (start, end) = if let Some((req_start, req_end)) = range {
if file_size == 0 || req_start >= file_size {
return StatusCode::RANGE_NOT_SATISFIABLE.into_response();
}
let end = req_end.unwrap_or(file_size - 1).min(file_size - 1);
(req_start, end)
} else {
if file_size == 0 {
// Serve empty file
+1 -1
View File
@@ -1005,7 +1005,7 @@ async fn xtream_get_stream_info_response(
axum::http::header::CONTENT_TYPE,
mime::APPLICATION_JSON.to_string()
)
.body(axum::body::Body::from(additional_properties.clone())));
.body(axum::body::Body::from(additional_properties.to_owned())));
}
}