mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-26 08:42:16 +01:00
fixed multiple targets had no content problem occured after refactoring
This commit is contained in:
@@ -406,7 +406,7 @@ Has the following top level entries:
|
||||
|
||||
#### 2.3.4.1 `filter`
|
||||
The filter is a string with a statement (@see filter statements).
|
||||
It is optional and allows you to
|
||||
It is optional and allows you to filter the content.
|
||||
|
||||
#### 2.3.4.2 `pattern`
|
||||
The pattern is a string with a statement (@see filter statements).
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::model::config::{ConfigInput, ConfigOptions};
|
||||
// https://siptv.eu/howto/playlist.html
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct FetchedPlaylist {
|
||||
pub input: ConfigInput,
|
||||
pub(crate) struct FetchedPlaylist<'a> {
|
||||
pub input: &'a ConfigInput,
|
||||
pub playlist: Vec<PlaylistGroup>,
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ fn process_source(cfg: Arc<Config>, source_idx: usize, user_targets: Arc<Process
|
||||
if !playlist.is_empty() {
|
||||
all_playlist.push(
|
||||
FetchedPlaylist {
|
||||
input: input.clone(),
|
||||
input,
|
||||
playlist,
|
||||
}
|
||||
);
|
||||
@@ -361,18 +361,25 @@ pub(crate) fn process_playlist(playlists: &mut [FetchedPlaylist],
|
||||
|
||||
debug!("Processing order is {}", &target.processing_order);
|
||||
|
||||
playlists.iter_mut().for_each(|pl| {
|
||||
let mut new_fetched_playlist : Vec<FetchedPlaylist> = vec![];
|
||||
playlists.iter_mut().for_each(|fpl| {
|
||||
let mut new_fpl = FetchedPlaylist {
|
||||
input: fpl.input,
|
||||
playlist: fpl.playlist.clone(),
|
||||
};
|
||||
for f in &pipe {
|
||||
let r = f(&mut pl.playlist, target);
|
||||
let playlist = &mut new_fpl.playlist;
|
||||
let r = f(playlist, target);
|
||||
if let Some(v) = r {
|
||||
pl.playlist = v;
|
||||
new_fpl.playlist = v;
|
||||
}
|
||||
}
|
||||
new_fetched_playlist.push(new_fpl);
|
||||
});
|
||||
|
||||
apply_affixes(playlists);
|
||||
let mut new_playlist = Vec::new();
|
||||
playlists.iter_mut().for_each(|fp| {
|
||||
apply_affixes(&mut new_fetched_playlist);
|
||||
let mut new_playlist = vec![];
|
||||
new_fetched_playlist.iter_mut().for_each(|fp| {
|
||||
fp.playlist.drain(..).for_each(|group| new_playlist.push(group));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user