mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-06 16:02:36 +02:00
some little fixes
This commit is contained in:
+2
-2
@@ -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(
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user