Formatting

This commit is contained in:
Connor Johnstone
2026-03-18 15:36:16 -04:00
parent a57df38eb1
commit 2592651c9a
8 changed files with 111 additions and 98 deletions

View File

@@ -156,9 +156,7 @@ fn make_backend_config(
output: &Option<PathBuf>,
cookies: &Option<PathBuf>,
) -> anyhow::Result<BackendConfig> {
let fmt: AudioFormat = format
.parse()
.map_err(|e: String| anyhow::anyhow!(e))?;
let fmt: AudioFormat = format.parse().map_err(|e: String| anyhow::anyhow!(e))?;
Ok(BackendConfig {
output_dir: output.clone().unwrap_or_else(default_output_dir),
format: fmt,
@@ -199,13 +197,12 @@ async fn main() -> anyhow::Result<()> {
let config = make_backend_config(&format, &output, &cookies)?;
// Determine if it's a URL or a search query
let target = if query_or_url.starts_with("http://")
|| query_or_url.starts_with("https://")
{
DownloadTarget::Url(query_or_url)
} else {
DownloadTarget::Query(query_or_url)
};
let target =
if query_or_url.starts_with("http://") || query_or_url.starts_with("https://") {
DownloadTarget::Url(query_or_url)
} else {
DownloadTarget::Query(query_or_url)
};
download_single(&backend, target, &config, dry_run).await?;
}
@@ -235,7 +232,8 @@ async fn main() -> anyhow::Result<()> {
println!("\nQueue processing complete: {stats}");
}
QueueAction::Add { query } => {
let item = queries::downloads::enqueue(db.conn(), &query, None, "ytdlp").await?;
let item =
queries::downloads::enqueue(db.conn(), &query, None, "ytdlp").await?;
println!("Added to queue: id={}, query=\"{}\"", item.id, item.query);
}
QueueAction::List { status } => {
@@ -254,8 +252,8 @@ async fn main() -> anyhow::Result<()> {
println!("Queue is empty.");
} else {
println!(
"{:<5} {:<12} {:<6} {:<40} {}",
"ID", "STATUS", "RETRY", "QUERY", "ERROR"
"{:<5} {:<12} {:<6} {:<40} ERROR",
"ID", "STATUS", "RETRY", "QUERY"
);
for item in &items {
println!(