mirror of
https://github.com/talwat/lowfi
synced 2025-01-13 11:51:27 +00:00
fix: add exemptions for contractions when formatting song names
This commit is contained in:
parent
3de4bbfdde
commit
4ee86ec4f2
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -982,7 +982,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "lowfi"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"arc-swap",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lowfi"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
edition = "2021"
|
||||
description = "An extremely simple lofi player."
|
||||
license = "MIT"
|
||||
|
@ -147,6 +147,10 @@ impl Player {
|
||||
|
||||
match msg {
|
||||
Messages::Next | Messages::Init => {
|
||||
// Skip as early as possible so that music doesn't play
|
||||
// while lowfi is "loading".
|
||||
queue.sink.stop();
|
||||
|
||||
// Serves as an indicator that the queue is "loading".
|
||||
// This is also set by Player::next.
|
||||
queue.current.store(None);
|
||||
@ -155,7 +159,6 @@ impl Player {
|
||||
// in the buffer.
|
||||
itx.send(()).await?;
|
||||
|
||||
queue.sink.stop();
|
||||
let track = Self::next(Arc::clone(&queue)).await?;
|
||||
queue.sink.append(track.data);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ async fn interface(queue: Arc<Player>) -> eyre::Result<()> {
|
||||
MoveUp(4)
|
||||
)?;
|
||||
|
||||
sleep(Duration::from_secs_f32(1.0 / 60.0)).await;
|
||||
sleep(Duration::from_secs_f32(10.0 / 60.0)).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,15 @@ impl TrackInfo {
|
||||
.unwrap()
|
||||
.strip_suffix(".mp3")
|
||||
.unwrap()
|
||||
.to_title_case();
|
||||
.to_title_case()
|
||||
// Inflector doesn't like contractions...
|
||||
// Replaces a few very common ones.
|
||||
// TODO: Properly handle these.
|
||||
.replace(" S ", "'s ")
|
||||
.replace(" T ", "'t ")
|
||||
.replace(" D ", "'d ")
|
||||
.replace(" Ve ", "'ve ")
|
||||
.replace(" M ", "'m ");
|
||||
|
||||
let mut skip = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user