mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-28 09:42:26 +01:00
user bouquet filter for xtream refactored
This commit is contained in:
@@ -104,11 +104,11 @@ async fn save_playlist_bouquet(
|
||||
req: web::Json<PlaylistBouquetDto>,
|
||||
) -> HttpResponse {
|
||||
if let Some(username) = get_username_from_auth_header(credentials, &app_state) {
|
||||
if let Some((user, _target)) = get_user_target_by_username(username.as_str(), &app_state).await {
|
||||
if let Some((user, target)) = get_user_target_by_username(username.as_str(), &app_state).await {
|
||||
if !user.has_permissions(&app_state) {
|
||||
return HttpResponse::Forbidden().finish();
|
||||
}
|
||||
match save_user_bouquet(&app_state.config, &username, &req.0) {
|
||||
match save_user_bouquet(&app_state.config, &target.name, &username, &req.0).await {
|
||||
Ok(()) => {
|
||||
return HttpResponse::Ok().finish();
|
||||
}
|
||||
|
||||
@@ -514,9 +514,9 @@ async fn xtream_player_api_handle_content_action(config: &Config, target_name: &
|
||||
if let Some(file_path) = path {
|
||||
// load user bouquet
|
||||
let filter = match action {
|
||||
ACTION_GET_LIVE_CATEGORIES => user_repository::user_get_bouquet_filter(config, target_name,&user.username, category_id, TargetType::Xtream, XtreamCluster::Live).await,
|
||||
ACTION_GET_VOD_CATEGORIES => user_repository::user_get_bouquet_filter(config, target_name, &user.username, category_id, TargetType::Xtream, XtreamCluster::Video).await,
|
||||
ACTION_GET_SERIES_CATEGORIES => user_repository::user_get_bouquet_filter(config, target_name, &user.username, category_id, TargetType::Xtream, XtreamCluster::Series).await,
|
||||
ACTION_GET_LIVE_CATEGORIES => user_repository::user_get_bouquet_filter(config, &user.username, category_id, TargetType::Xtream, XtreamCluster::Live).await,
|
||||
ACTION_GET_VOD_CATEGORIES => user_repository::user_get_bouquet_filter(config, &user.username, category_id, TargetType::Xtream, XtreamCluster::Video).await,
|
||||
ACTION_GET_SERIES_CATEGORIES => user_repository::user_get_bouquet_filter(config, &user.username, category_id, TargetType::Xtream, XtreamCluster::Series).await,
|
||||
_ => None
|
||||
};
|
||||
if let Some(flt) = filter {
|
||||
|
||||
Reference in New Issue
Block a user