Added m3u logo url rewrite in reverse proxy mode or with m3u_mask_redirect_url option.

This commit is contained in:
euzu
2025-01-03 13:08:46 +01:00
parent 459c0e4a84
commit 1efa22ba14
16 changed files with 193 additions and 73 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ use crate::model::config::ConfigInput;
use crate::model::playlist::{PlaylistGroup, PlaylistItem, PlaylistItemHeader, PlaylistItemType, XtreamCluster};
use crate::model::xtream::{XtreamCategory, XtreamSeriesInfo, XtreamSeriesInfoEpisode, XtreamStream};
use crate::repository::storage::hash_string;
use crate::utils::request_utils::mask_sensitive_info;
fn map_to_xtream_category(categories: &Value) -> Result<Vec<XtreamCategory>, M3uFilterError> {
match serde_json::from_value::<Vec<XtreamCategory>>(categories.to_owned()) {
@@ -54,7 +55,7 @@ pub fn parse_xtream_series_info(info: &Value, group_title: &str, series_name: &s
id: Rc::new(episode.id.to_string()),
uuid: Rc::new(hash_string(&episode_url)),
name: Rc::new(series_name.to_string()),
logo: Rc::new(episode.info.movie_image.clone()),
logo: Rc::new(episode.info.as_ref().map_or_else(String::new, |info| info.movie_image.to_string())),
group: Rc::new(group_title.to_string()),
title: Rc::new(episode.title.clone()),
url: episode_url,
@@ -69,7 +70,7 @@ pub fn parse_xtream_series_info(info: &Value, group_title: &str, series_name: &s
if result.is_empty() { Ok(None) } else { Ok(Some(result)) }
}
Err(err) => {
create_m3u_filter_error_result!(M3uFilterErrorKind::Notify, "Failed to process series info {}", &err)
create_m3u_filter_error_result!(M3uFilterErrorKind::Notify, "Failed to process series info {} {}", &err, mask_sensitive_info(url))
}
}
}