mirror of
https://github.com/talwat/lowfi
synced 2024-12-26 19:21:54 +00:00
feat: remove play command
This commit is contained in:
parent
1b2466e1f8
commit
5149723b5c
@ -8,3 +8,6 @@ It'll do this as simply as it can: no albums, no ads, just lofi.
|
|||||||
I really hate modern music platforms, and I wanted a small, "suckless"
|
I really hate modern music platforms, and I wanted a small, "suckless"
|
||||||
app that would literally just play lofi without video so I could use it
|
app that would literally just play lofi without video so I could use it
|
||||||
whenever.
|
whenever.
|
||||||
|
|
||||||
|
I also wanted it to be fairly resiliant to inconsistent networks,
|
||||||
|
so it buffers 5 whole songs at a time instead of parts of the same song.
|
||||||
|
21
src/main.rs
21
src/main.rs
@ -10,7 +10,7 @@ mod tracks;
|
|||||||
#[command(about)]
|
#[command(about)]
|
||||||
struct Args {
|
struct Args {
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: Commands,
|
command: Option<Commands>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
@ -24,20 +24,21 @@ enum Commands {
|
|||||||
/// Whether to include the full HTTP URL or just the distinguishing part.
|
/// Whether to include the full HTTP URL or just the distinguishing part.
|
||||||
#[clap(long, short)]
|
#[clap(long, short)]
|
||||||
include_full: bool,
|
include_full: bool,
|
||||||
},
|
}
|
||||||
/// Starts the player.
|
|
||||||
Play,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> eyre::Result<()> {
|
async fn main() -> eyre::Result<()> {
|
||||||
let cli = Args::parse();
|
let cli = Args::parse();
|
||||||
|
|
||||||
match cli.command {
|
if let Some(command) = cli.command {
|
||||||
Commands::Scrape {
|
match command {
|
||||||
extention,
|
Commands::Scrape {
|
||||||
include_full,
|
extention,
|
||||||
} => scrape::scrape(extention, include_full).await,
|
include_full,
|
||||||
Commands::Play => play::play().await,
|
} => scrape::scrape(extention, include_full).await
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
play::play().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user