some little fixes

This commit is contained in:
euzu
2024-12-29 11:36:44 +01:00
parent 47f18ed867
commit 6873e51ef0
4 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -151,13 +151,13 @@ async fn playlist(
req: web::Json<PlaylistRequest>,
app_state: web::Data<AppState>,
) -> HttpResponse {
return if let Some(input_id) = req.input_id {
if let Some(input_id) = req.input_id {
get_playlist(app_state.config.get_input_by_id(input_id), &app_state.config).await
} else {
let url = req.url.as_deref().unwrap_or("");
let input = create_config_input_for_url(url);
get_playlist(Some(&input), &app_state.config).await
};
}
}
async fn config(
+3 -4
View File
@@ -492,8 +492,7 @@ fn xtream_create_content_stream(xtream_iter: impl Iterator<Item=String>) -> impl
format!(",{line}")
};
Ok::<Bytes, String>(Bytes::from(line))
}))
.chain(stream::once(async { Ok::<Bytes, String>(Bytes::from("]")) })))
})).chain(stream::once(async { Ok::<Bytes, String>(Bytes::from("]")) })))
}
@@ -544,8 +543,8 @@ pub fn xtream_api_register(cfg: &mut web::ServiceConfig) {
("/series", xtream_player_api_series_stream)]);
register_xtream_api_timeshift!(cfg, [
"/timeshift/{username}/{password}/{duration}/{start}/{stream_id}",
"/timeshift.php",
"/streaming/timeshift.php"]);
"/timeshift.php",
"/streaming/timeshift.php"]);
/* TODO
cfg.service(web::resource("/hlsr/{token}/{username}/{password}/{channel}/{hash}/{chunk}").route(web::get().to(xtream_player_api_hlsr_stream)));
cfg.service(web::resource("/hls/{token}/{chunk}").route(web::get().to(xtream_player_api_hls_stream)));