Some refactorings

- HdHomerun
- WebUI GeoIP
- Playlist Updates
...
This commit is contained in:
euzu
2025-10-28 20:21:36 +01:00
parent cd76891ce4
commit 62db7affc3
5 changed files with 38 additions and 19 deletions
+8 -9
View File
@@ -27,6 +27,7 @@ use crate::repository::playlist_repository::persist_playlist;
use crate::utils::debug_if_enabled;
use crate::utils::StepMeasure;
use deunicode::deunicode;
use futures::StreamExt;
use log::{debug, error, info, log_enabled, trace, warn, Level};
use reqwest::Client;
use shared::error::{get_errors_notify_message, notify_err, TuliproxError};
@@ -627,15 +628,13 @@ async fn process_watch(cfg: &Config, client: &Arc<reqwest::Client>, target: &Con
return false;
}
let mut futs = Vec::new();
for pl in new_playlist {
if watches.iter().any(|r| r.is_match(&pl.title)) {
futs.push(process_group_watch(client, cfg, &target.name, pl));
}
}
if !futs.is_empty() {
futures::future::join_all(futs).await;
}
futures::stream::iter(
new_playlist
.iter()
.filter(|pl| watches.iter().any(|r| r.is_match(&pl.title)))
.map(|pl| process_group_watch(client, cfg, &target.name, pl))
).for_each_concurrent(16, |f| f).await;
true
} else {
false