mirror of
https://github.com/talwat/lowfi
synced 2024-12-26 03:01:55 +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"
|
||||
app that would literally just play lofi without video so I could use it
|
||||
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)]
|
||||
struct Args {
|
||||
#[command(subcommand)]
|
||||
command: Commands,
|
||||
command: Option<Commands>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
@ -24,20 +24,21 @@ enum Commands {
|
||||
/// Whether to include the full HTTP URL or just the distinguishing part.
|
||||
#[clap(long, short)]
|
||||
include_full: bool,
|
||||
},
|
||||
/// Starts the player.
|
||||
Play,
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
let cli = Args::parse();
|
||||
|
||||
match cli.command {
|
||||
Commands::Scrape {
|
||||
extention,
|
||||
include_full,
|
||||
} => scrape::scrape(extention, include_full).await,
|
||||
Commands::Play => play::play().await,
|
||||
if let Some(command) = cli.command {
|
||||
match command {
|
||||
Commands::Scrape {
|
||||
extention,
|
||||
include_full,
|
||||
} => scrape::scrape(extention, include_full).await
|
||||
}
|
||||
} else {
|
||||
play::play().await
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user