fixed hdhomerun config check

This commit is contained in:
euzu
2025-07-08 13:47:49 +02:00
parent ecedd2e1df
commit 2f26468499
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -93,7 +93,11 @@ impl AppConfig {
}
}
fn check_target_user(&self) -> Result<(), TuliproxError> {
let check_homerun = self.hdhomerun.load().as_ref().is_some_and(|h| h.enabled);
let check_homerun = {
let config = <Arc<ArcSwap<Config>> as Access<Config>>::load(&self.config);
self.hdhomerun.store(config.hdhomerun.as_ref().map(|h| Arc::new(h.clone())));
config.hdhomerun.as_ref().is_some_and(|h| h.enabled)
};
let sources = <Arc<ArcSwap<SourcesConfig>> as Access<SourcesConfig>>::load(&self.sources);
for source in &sources.sources {
for target in &source.targets {
+1 -1
View File
@@ -116,7 +116,7 @@ impl ApiProxyConfigDto {
if token.is_empty() {
user.token = None;
} else if tokens.contains(token) {
errors.push(format!("Non unique token found {}", &user.username));
errors.push(format!("Non unique user token found {} for user {}", &user.token.as_ref().map_or_else(String::new, ToString::to_string), &user.username));
} else {
tokens.insert(token.to_string());
}