diff --git a/CHANGELOG.md b/CHANGELOG.md index 817803746..13ad887bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,37 @@ If we assume the variable `station` contains the value `WINK`, this script receives the template with the concatenated name `US_WINK_PREFIX` which should be defined in `templates` section, and assigns it to the variable `station_prefix`. -- Enhanced the STRM export functionality by adding configurable naming styles and an optional flat directory structure for Kodi,Plex,Jellyfin,Emby. - -# 3.1.4 (???) - Extended STRM export functionality with: - Support for various media tools (Kodi, Plex, Emby, Jellyfin), with consideration for recommended naming conventions and file organization. - Optional flat directory structure via 'flat' parameter (nested folder structures are not supported by some media scanners). +- Added Trakt support for XC targets +``` + - name: iptv-trakt-example + output: + - type: xtream + skip_live_direct_source: true + skip_video_direct_source: true + skip_series_direct_source: true + resolve_series: false + resolve_vod: false + trakt: + lists: + - user: "linaspurinis" + list_slug: "top-watched-movies-of-the-week" + category_name: "📈 Top Weekly Movies" + content_type: "vod" + fuzzy_match_threshold: 80 + - user: "garycrawfordgc" + list_slug: "latest-tv-shows" + category_name: "📺 Latest TV Shows" + content_type: "series" + fuzzy_match_threshold: 75 + - user: "trakt" + list_slug: "trending" + category_name: "🔥 Trending" + content_type: "both" + fuzzy_match_threshold: 80 +``` # 3.1.3 (2025-06-06) - Fixed xtream codes series info duplicate fields problem. diff --git a/config/source.yml b/config/source.yml index 6c9b8aede..3851e513b 100644 --- a/config/source.yml +++ b/config/source.yml @@ -29,8 +29,8 @@ sources: output: - type: xtream skip_live_direct_source: true - skip_video_direct_source: false - skip_series_direct_source: false + skip_video_direct_source: true + skip_series_direct_source: true resolve_series: false resolve_vod: false trakt: diff --git a/src/model/config_target.rs b/src/model/config_target.rs index 6a899c1b8..e4813eea0 100644 --- a/src/model/config_target.rs +++ b/src/model/config_target.rs @@ -128,7 +128,6 @@ pub struct XtreamTargetOutput { pub trakt: Option, } - impl XtreamTargetOutput { pub fn prepare(&mut self) { if let Some(trakt) = &mut self.trakt { diff --git a/src/processing/processor/trakt.rs b/src/processing/processor/trakt.rs index 020eb3c99..48f2827d5 100644 --- a/src/processing/processor/trakt.rs +++ b/src/processing/processor/trakt.rs @@ -60,6 +60,8 @@ fn calculate_year_bonus(playlist_year: Option, trakt_year: Option) -> if p_year == t_year { // Perfect year match gets substantial bonus return 0.15; + } else { + return -0.15; } } 0.0 @@ -122,7 +124,7 @@ fn find_best_fuzzy_match_for_item<'a>(channel: (&'a PlaylistItem, String, Option best_match = Some((trakt_item, combined_score)); } // early exit strategy - if combined_score >= 99.0 { + if combined_score >= 0.99 { break; } } diff --git a/src/utils/trakt/mod.rs b/src/utils/trakt/mod.rs index a52b000e0..fb51ced11 100644 --- a/src/utils/trakt/mod.rs +++ b/src/utils/trakt/mod.rs @@ -18,7 +18,7 @@ pub fn normalize_title_for_matching(title: &str) -> String { } if CONSTANTS.re_trakt_year.is_match(&result) { - result[..result.len() - 4].to_string() + CONSTANTS.re_trakt_year.replace(&result, "").into_owned() } else { result }