Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
tracks it queued, instead of keeping a pause button over its cover.
- Lyrics timed with hours, such as `[01:02:03.00]`, show at the right moment instead of being
skipped.
- An untagged song named like `01. Title` keeps the title and drops the track number, instead
of using the whole filename.
- Deezer playlists and favorites show the day they were added or last changed, instead of leaving
the date column blank.
- A Deezer song whose explicit flag arrives as a number still shows the explicit mark.
Expand Down
13 changes: 12 additions & 1 deletion crates/music/src/local/wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,18 @@ fn infer_from_stem(stem: &str) -> (Option<String>, Option<String>) {
return (Some(left.to_owned()), Some(right.to_owned()));
}
}
(None, None)
numbered(stem)
.map(|title| (Some(title), None))
.unwrap_or((None, None))
}

fn numbered(stem: &str) -> Option<String> {
let (digits, rest) = stem.split_once('.')?;
if digits.is_empty() || digits.len() > 3 || !digits.chars().all(|c| c.is_ascii_digit()) {
return None;
}
let rest = rest.trim();
(!rest.is_empty()).then(|| rest.to_owned())
}

struct FallbackProbe {
Expand Down
Loading