summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock12
-rw-r--r--src/db.rs9
2 files changed, 11 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index aa12f8c..cdd5ef8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -216,9 +216,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.40"
+version = "1.2.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb"
+checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
dependencies = [
"find-msvc-tools",
"jobserver",
@@ -488,9 +488,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "find-msvc-tools"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3"
+checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "flac-bound"
@@ -831,9 +831,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.176"
+version = "0.2.177"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
+checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
[[package]]
name = "libflac-sys"
diff --git a/src/db.rs b/src/db.rs
index 99b577e..a4896ee 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -5,6 +5,7 @@ use std::{
path::{Path, PathBuf},
time::UNIX_EPOCH,
};
+use tokio::fs;
use turso::{Connection, params, transaction::Transaction};
const TABLE_CREATE: &str = "CREATE TABLE IF NOT EXISTS flacs (path TEXT PRIMARY KEY UNIQUE, toencode BOOLEAN NOT NULL, modtime INTEGER)";
@@ -38,8 +39,8 @@ pub(crate) async fn init_db(path: Option<&PathBuf>) -> Result<turso::Database> {
pub(crate) async fn insert_file<'a>(tx: Transaction<'a>, filename: &Path) -> Result<()> {
let toencode = !matches!(get_vendor(filename)?.as_str(), CURRENT_VENDOR);
- let modtime = filename
- .metadata()?
+ let modtime = fs::metadata(filename)
+ .await?
.modified()?
.duration_since(UNIX_EPOCH)?
.as_secs();
@@ -56,8 +57,8 @@ pub(crate) async fn insert_file<'a>(tx: Transaction<'a>, filename: &Path) -> Res
}
pub(crate) async fn update_file<'a>(tx: Transaction<'a>, filename: &Path) -> Result<()> {
- let modtime = filename
- .metadata()?
+ let modtime = fs::metadata(filename)
+ .await?
.modified()?
.duration_since(UNIX_EPOCH)?
.as_secs();