Skip to content

Commit d61f6e1

Browse files
test(library): fix windows skill issue (#346)
1 parent 7b87d76 commit d61f6e1

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/library/scan/discover.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
Arc,
44
atomic::{AtomicBool, Ordering},
55
},
6-
time::{Duration, SystemTime, UNIX_EPOCH},
6+
time::{Duration, SystemTime},
77
};
88

99
use camino::{Utf8Path, Utf8PathBuf};
@@ -35,17 +35,13 @@ fn file_scan_timestamp(path: &Utf8Path) -> Option<SystemTime> {
3535
};
3636

3737
let presence_offset = if lyrics_timestamp.is_some() {
38-
Duration::from_nanos(1)
38+
// Must be >= 100ns (Windows SystemTime resolution is 100ns).
39+
Duration::from_micros(1)
3940
} else {
4041
Duration::ZERO
4142
};
42-
UNIX_EPOCH
43-
.checked_add(
44-
base_timestamp
45-
.duration_since(UNIX_EPOCH)
46-
.ok()?
47-
.checked_add(presence_offset)?,
48-
)
43+
base_timestamp
44+
.checked_add(presence_offset)
4945
.or(Some(base_timestamp))
5046
}
5147

0 commit comments

Comments
 (0)