mirror of
https://github.com/talwat/lowfi
synced 2025-12-07 23:47:46 +00:00
chore: tidy up tokio dependency
This commit is contained in:
parent
702f29978f
commit
4f3fa02cb4
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -2613,9 +2613,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.23.7"
|
||||
version = "0.23.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d"
|
||||
checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"toml_datetime",
|
||||
|
||||
14
Cargo.toml
14
Cargo.toml
@ -20,7 +20,13 @@ repository = "https://github.com/talwat/lowfi"
|
||||
[features]
|
||||
mpris = ["dep:mpris-server"]
|
||||
extra-audio-formats = ["rodio/default"]
|
||||
scrape = ["dep:serde", "dep:serde_json", "dep:html-escape", "dep:scraper", "dep:indicatif"]
|
||||
scrape = [
|
||||
"dep:serde",
|
||||
"dep:serde_json",
|
||||
"dep:html-escape",
|
||||
"dep:scraper",
|
||||
"dep:indicatif",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
# Basics
|
||||
@ -30,9 +36,9 @@ fastrand = "2.3.0"
|
||||
thiserror = "2.0.12"
|
||||
|
||||
# Async
|
||||
tokio = { version = "1.41.1", features = ["macros", "rt", "fs", "io-util"], default-features = false }
|
||||
tokio = { version = "1.41.1", features = ["macros", "rt", "fs", "io-util", "sync", "time"], default-features = false }
|
||||
futures-util = { version = "0.3.31", default-features = false }
|
||||
arc-swap = "1.7.1"
|
||||
futures-util = { version = "0.3.31", default-features = false, features = ["io"]}
|
||||
|
||||
# Data
|
||||
reqwest = { version = "0.12.9", features = ["stream", "http2", "default-tls"], default-features = false }
|
||||
@ -46,7 +52,7 @@ dirs = "6.0.0"
|
||||
|
||||
# Text processing
|
||||
unicode-segmentation = "1.12.0"
|
||||
url = "2.5.4"
|
||||
url = { version = "2.5.4", default-features = false }
|
||||
|
||||
# Scraper
|
||||
serde = { version = "1.0.219", features = ["derive"], optional = true }
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@ -98,9 +98,12 @@ pub fn data_dir() -> crate::Result<PathBuf> {
|
||||
|
||||
/// Simply creates and runs the player, so that the [`Result`] of both operations
|
||||
/// can be easily handled by the [`main`] function.
|
||||
async fn player(args: Args, environment: ui::Environment) -> crate::Result<()> {
|
||||
let stream = audio::stream()?;
|
||||
let mut player = Player::init(args, environment, stream.mixer()).await?;
|
||||
async fn player(
|
||||
args: Args,
|
||||
environment: ui::Environment,
|
||||
mixer: &rodio::mixer::Mixer,
|
||||
) -> crate::Result<()> {
|
||||
let mut player = Player::init(args, environment, mixer).await?;
|
||||
player.run().await?;
|
||||
|
||||
Ok(())
|
||||
@ -126,8 +129,9 @@ async fn main() -> eyre::Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
let stream = audio::stream()?;
|
||||
let environment = ui::Environment::ready(args.alternate)?;
|
||||
let result = player(args, environment).await;
|
||||
let result = player(args, environment, stream.mixer()).await;
|
||||
environment.cleanup(result.is_ok())?;
|
||||
|
||||
Ok(result?)
|
||||
|
||||
@ -6,7 +6,8 @@ use clap::ValueEnum;
|
||||
use eyre::bail;
|
||||
use reqwest::Client;
|
||||
use tokio::{
|
||||
fs::{self, File}, io::AsyncWriteExt,
|
||||
fs::{self, File},
|
||||
io::AsyncWriteExt,
|
||||
};
|
||||
|
||||
pub mod archive;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user