mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-16 04:42:18 +02:00
Integrate local movie file into playlist
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user