mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-28 20:12:12 +02:00
Add is_trakt_group field to PlaylistGroup and update sorting logic
- Introduced `is_trakt_group` field in `PlaylistGroup` struct to differentiate between Trakt and non-Trakt groups. - Updated relevant parsing functions in `m3u.rs`, `xtream.rs`, and `trakt.rs` to set this field appropriately. - Enhanced sorting logic in `sort.rs` to prioritize Trakt groups during playlist sorting. - Ensured backward compatibility by defaulting `is_trakt_group` to false where applicable.
This commit is contained in:
@@ -266,7 +266,7 @@ where
|
||||
if let Some((cluster, group_title)) = channel.map(|pli|
|
||||
(pli.header.xtream_cluster, &pli.header.group)) {
|
||||
grp_id += 1;
|
||||
Some(PlaylistGroup { id: grp_id, xtream_cluster: cluster, title: group_title.to_string(), channels })
|
||||
Some(PlaylistGroup { id: grp_id, xtream_cluster: cluster, title: group_title.to_string(), channels, is_trakt_group: false })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
xtream_cluster,
|
||||
title: category.category_name.to_string(),
|
||||
channels: category.channels.clone(),
|
||||
is_trakt_group: false,
|
||||
}
|
||||
}).collect()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user