diff --git a/README.md b/README.md index e824d1705..c46628eff 100644 --- a/README.md +++ b/README.md @@ -548,6 +548,12 @@ epg: `strip : ["3840p", "uhd", "fhd", "hd", "sd", "4k", "plus", "raw"]` this is the defualt `normalize_regex: [^a-zA-Z0-9\-]` is the default +The fuzzy matching tries to guess the EPG ID for a given channel. Some keys are generated based on the channel name for similarity search. +When looking at playlists, it's common for a country prefix to be included in the name, such as `US:` or `FR|`. +The `name_prefix_separator` defines the possible separator characters used to identify this part. +For EPG IDs, the country code is typically added as a suffix, like cnn.us. This is controlled by the name_prefix attribute. +The `!suffix '.'` setting means: if a prefix is found, append it to the name using the given separator character (in this case, a dot). + ```yaml # single epg url: 'https://localhost.com/epg.xml' @@ -1029,9 +1035,10 @@ Attributes is a map of key value pairs. Valid keys are: - `id` - `epg_channel_id` or `epg_id` - `chno` -- `name` - `group` +- `name` - `title` +- `caption` (for `title and `name`) - `logo` - `logo_small` - `parent_code` @@ -1111,9 +1118,10 @@ If the regexps matches, the given fields will be prefixed to field value Attributes is a map of key value pairs. Valid keys and values are: - `id` - `chno` -- `name` - `group` +- `name` - `title` +- `caption` (for `title and `name`) - `logo` - `logo_small` - `parent_code` diff --git a/src/processing/processor/epg.rs b/src/processing/processor/epg.rs index 43981cecd..c7ac18fda 100644 --- a/src/processing/processor/epg.rs +++ b/src/processing/processor/epg.rs @@ -141,11 +141,9 @@ fn assign_channel_epg(new_epg: &mut Vec, fp: &mut FetchedPlaylist, id_cache .map(|t| (t.get_attribute_value(EPG_ATTRIB_ID).unwrap(), t)).collect(); let filter_live = |c: &&mut PlaylistItem| c.header.xtream_cluster == XtreamCluster::Live; - // let filter_missing_epg_id = |chan: &mut PlaylistItem| chan.header.epg_channel_id.is_none() || chan.header.logo.is_empty() || chan.header.logo_small.is_empty(); - let filter_missing_epg_id = |chan: &&mut PlaylistItem| chan.header.epg_channel_id.is_none(); let assign_values = |chan: &mut PlaylistItem| { - if id_cache.smart_match_enabled { + if id_cache.smart_match_enabled && chan.header.epg_channel_id.is_none() { // if the channel has no epg_id or the epg_id is not present in xmltv/tvguide then we need to match one from existing tvguide let not_processed = match &chan.header.epg_channel_id { None => true, @@ -175,7 +173,6 @@ fn assign_channel_epg(new_epg: &mut Vec, fp: &mut FetchedPlaylist, id_cache fp.playlistgroups.iter_mut() .flat_map(|g| &mut g.channels) .filter(filter_live) - .filter(filter_missing_epg_id) .for_each(assign_values); new_epg.push(epg); }