gtauri: zero-delay handling for Android MediaStore content watcher events (immediate push)
This commit is contained in:
parent
15a857ed7f
commit
471d2faeab
|
|
@ -1237,9 +1237,17 @@ fn watch_files(app: tauri::AppHandle) {
|
||||||
};
|
};
|
||||||
let do_full = matches!(woke, Some(WEvent::Full));
|
let do_full = matches!(woke, Some(WEvent::Full));
|
||||||
if let Some(WEvent::Fs) = woke {
|
if let Some(WEvent::Fs) = woke {
|
||||||
while rx.try_recv().is_ok() {}
|
#[cfg(target_os = "android")]
|
||||||
std::thread::sleep(std::time::Duration::from_millis(600));
|
{
|
||||||
while rx.try_recv().is_ok() {}
|
apply_mediasotre_payload(&app);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
{
|
||||||
|
while rx.try_recv().is_ok() {}
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(600));
|
||||||
|
while rx.try_recv().is_ok() {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if do_full {
|
if do_full {
|
||||||
tr("watch: full rescan (5min)");
|
tr("watch: full rescan (5min)");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user