mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-05 07:22:17 +02:00
feat: prevent duplicate xtream info fetches for mapping aliases
This commit is contained in:
@@ -206,9 +206,11 @@ fn map_channel(mut channel: PlaylistItem, mapping: &Mapping) -> (PlaylistItem, b
|
||||
fn map_channel_with_aliases(channel: PlaylistItem, mapping: &Mapping) -> Vec<PlaylistItem> {
|
||||
if mapping.create_alias {
|
||||
let original = channel.clone();
|
||||
let base_uuid = *original.header.get_uuid();
|
||||
let (mut mapped_channel, matched) = map_channel(channel, mapping);
|
||||
if matched {
|
||||
mapped_channel.header.uuid = create_alias_uuid(original.header.get_uuid(), &mapping.id);
|
||||
mapped_channel.header.alias_of = Some(base_uuid);
|
||||
vec![original, mapped_channel]
|
||||
} else {
|
||||
vec![mapped_channel]
|
||||
|
||||
@@ -82,6 +82,9 @@ pub(in crate::processing) fn create_resolve_info_wal_files(cfg: &Config, input:
|
||||
pub(in crate::processing) fn should_update_info(pli: &mut PlaylistItem, processed_provider_ids: &HashMap<u32, u64>, field: &str) -> (bool, u32, u64) {
|
||||
let Some(provider_id) = pli.header.get_provider_id() else { return (false, 0, 0) };
|
||||
let last_modified = pli.header.get_additional_property_as_u64(field);
|
||||
if pli.header.alias_of.is_some() {
|
||||
return (false, provider_id, last_modified.unwrap_or(0));
|
||||
}
|
||||
let old_timestamp = processed_provider_ids.get(&provider_id);
|
||||
(old_timestamp.is_none()
|
||||
|| last_modified.is_none()
|
||||
|
||||
Reference in New Issue
Block a user