chore: 更好地按帧发送灯条数据。
This commit is contained in:
@@ -27,11 +27,13 @@ impl Picker {
|
||||
|
||||
SCREEN_COLOR_PICKER
|
||||
.get_or_init(|| async {
|
||||
let configs = config::Manager::global().get_config().await.display_configs;
|
||||
info!("Global Picker use configs. {:?}", configs);
|
||||
Picker {
|
||||
screens: Arc::new(Mutex::new(vec![])),
|
||||
screenshots: Arc::new(Mutex::new(vec![])),
|
||||
display_configs: Arc::new(Mutex::new(
|
||||
config::Manager::global().get_config().await.display_configs,
|
||||
configs,
|
||||
)),
|
||||
}
|
||||
})
|
||||
@@ -39,12 +41,12 @@ impl Picker {
|
||||
}
|
||||
|
||||
pub async fn list_displays(&self) -> anyhow::Result<Vec<ScreenshotDto>> {
|
||||
let mut configs = self.display_configs.lock().await;
|
||||
let mut configs = vec![];
|
||||
|
||||
let displays = Display::all()
|
||||
.map_err(|error| anyhow::anyhow!("Can not get all of displays. {}", error))?;
|
||||
|
||||
configs.clear();
|
||||
// configs.clear();
|
||||
let mut futs = FuturesUnordered::new();
|
||||
|
||||
for (index, display) in displays.iter().enumerate() {
|
||||
|
Reference in New Issue
Block a user