mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-20 23:02:34 +02:00
fixed hdhomerun config check
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user