diff --git a/config/source.yml b/config/source.yml index 3851e513b..61ad23566 100644 --- a/config/source.yml +++ b/config/source.yml @@ -50,5 +50,10 @@ sources: category_name: "🔥 Trending" content_type: "both" fuzzy_match_threshold: 80 + - user: "mmozeiko" + list_slug: "star-wars-universe" + category_name: "🌌 Univers Star Wars" + content_type: "both" + fuzzy_match_threshold: 80 filter: "!final_channel_lineup!" options: { ignore_logo: false, share_live_streams: true } diff --git a/src/model/trakt.rs b/src/model/trakt.rs index 5246aa180..f923de0c3 100644 --- a/src/model/trakt.rs +++ b/src/model/trakt.rs @@ -88,7 +88,7 @@ pub struct TraktListItem { impl TraktListItem { pub fn prepare(&mut self) { self.content_type = match self.item_type.as_str() { - "movie" => TraktContentType::Vod, + "movie" => if self.movie.is_some() { TraktContentType::Vod } else { TraktContentType::Both }, "show" => if self.show.is_some() { TraktContentType::Series } else { TraktContentType::Both }, _ => TraktContentType::Both, } @@ -168,12 +168,12 @@ pub struct TraktMatchResult<'a> { pub playlist_item: &'a PlaylistItem, pub trakt_item: &'a TraktMatchItem<'a>, pub match_score: f64, - pub match_type: MatchType, + // pub match_type: MatchType, } -#[derive(Debug, Clone, PartialEq)] -pub enum MatchType { - TmdbExact, - FuzzyTitle, - FuzzyTitleYear, -} \ No newline at end of file +// #[derive(Debug, Clone, PartialEq)] +// pub enum MatchType { +// TmdbExact, +// FuzzyTitle, +// FuzzyTitleYear, +// } \ No newline at end of file diff --git a/src/processing/processor/trakt.rs b/src/processing/processor/trakt.rs index 48f2827d5..a041a32e1 100644 --- a/src/processing/processor/trakt.rs +++ b/src/processing/processor/trakt.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; use crate::model::{ConfigTarget, FieldGetAccessor, FieldSetAccessor, PlaylistGroup, PlaylistItem, XtreamCluster}; -use crate::model::{MatchType, TraktConfig, TraktContentType, TraktListConfig, TraktListItem, TraktMatchItem, TraktMatchResult}; +use crate::model::{TraktConfig, TraktContentType, TraktListConfig, TraktListItem, TraktMatchItem, TraktMatchResult}; use crate::tuliprox_error::TuliproxError; use crate::utils::trakt::client::TraktClient; use crate::utils::trakt::extract_year_from_title; @@ -59,41 +59,11 @@ fn calculate_year_bonus(playlist_year: Option, trakt_year: Option) -> if let (Some(p_year), Some(t_year)) = (playlist_year, trakt_year) { if p_year == t_year { // Perfect year match gets substantial bonus - return 0.15; - } else { - return -0.15; + return 0.5; } + return -0.5; } 0.0 - // match (playlist_year, trakt_year) { - // (Some(p_year), Some(t_year)) => { - // if p_year == t_year { - // // Perfect year match gets substantial bonus - // 0.15 - // } else { - // let year_diff = p_year.abs_diff(t_year); - // - // if year_diff <= 1 { - // // 1-year difference gets small bonus (could be release date differences) - // 0.05 - // } else if year_diff <= 3 { - // // 2-3 years difference gets small penalty - // -0.05 - // } else { - // // More than 3 years difference gets larger penalty - // -0.15 - // } - // } - // } - // (Some(_), None) | (None, Some(_)) => { - // // One has year, other doesn't - small penalty - // -0.05 - // } - // (None, None) => { - // // Neither has year - no bonus/penalty - // 0.0 - // } - // } } fn find_best_fuzzy_match_for_item<'a>(channel: (&'a PlaylistItem, String, Option, Option), trakt_items: &'a [TraktMatchItem], list_config: &'a TraktListConfig) -> Option> { @@ -132,19 +102,19 @@ fn find_best_fuzzy_match_for_item<'a>(channel: (&'a PlaylistItem, String, Option } if let Some((trakt_item, combined_score)) = best_match { - let match_type = if playlist_year.is_some() && trakt_item.year.is_some() { - MatchType::FuzzyTitleYear - } else { - MatchType::FuzzyTitle - }; + // let match_type = if playlist_year.is_some() && trakt_item.year.is_some() { + // MatchType::FuzzyTitleYear + // } else { + // MatchType::FuzzyTitle + // }; - trace_if_enabled!("Fuzzy match: '{}' -> '{}' (final: {combined_score:.3}, type: {match_type:?})", channel.0.header.title, trakt_item.title); + trace_if_enabled!("Fuzzy match: '{}' -> '{}' (final: {combined_score:.3}" /*, type: {match_type:?})"*/, channel.0.header.title, trakt_item.title); return Some(TraktMatchResult { playlist_item: channel.0, trakt_item, match_score: combined_score, - match_type: match_type.clone(), + // match_type: match_type.clone(), }); } @@ -165,7 +135,7 @@ fn find_best_match_for_item<'a>( playlist_item: channel.0, trakt_item, match_score: 1.0, - match_type: MatchType::TmdbExact, + // match_type: MatchType::TmdbExact, }); } } @@ -193,7 +163,6 @@ fn create_category_from_matches<'a>( )) }); - let group_title = &list_config.category_name; for match_result in sorted_matches {