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
8 changes: 4 additions & 4 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ chrono = { version = "0.4", features = ["serde"] }

# Library scanning
walkdir = "2"
lofty = "0.22"
lofty = "0.24"
blake3 = "1"

# Audio playback: symphonia decodes, cpal outputs, rubato resamples,
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/commands/lyrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ fn read_embedded_lyrics(path: &Path) -> Option<String> {
let tag = tagged.primary_tag().or_else(|| tagged.first_tag())?;
// ItemKey::Lyrics maps to the right key for every supported format.
let raw = tag
.get_string(&ItemKey::Lyrics)
.get_string(ItemKey::Lyrics)
.map(|s| s.to_string())
.or_else(|| {
// Some MP3s store lyrics under a non-standard key — fall
// back to the generic `lyrics()` accessor when present.
#[allow(deprecated)]
tag.get_string(&ItemKey::Description)
tag.get_string(ItemKey::Description)
.filter(|s| s.lines().count() > 3)
.map(|s| s.to_string())
})?;
Expand Down
8 changes: 4 additions & 4 deletions src-tauri/src/commands/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ fn extract_cover(tag: &Tag, artwork_dir: &Path) -> Option<ExtractedCover> {
/// `RATING` as plain text 0-100 which we rescale to 0-255.
fn extract_rating(tag: &Tag) -> Option<u8> {
if matches!(tag.tag_type(), TagType::Id3v2) {
if let Some(bytes) = tag.get_binary(&ItemKey::Popularimeter, false) {
if let Some(bytes) = tag.get_binary(ItemKey::Popularimeter, false) {
let nul_pos = bytes.iter().position(|b| *b == 0)?;
return bytes.get(nul_pos + 1).copied();
}
}
if let Some(text) = tag.get_string(&ItemKey::Popularimeter) {
if let Some(text) = tag.get_string(ItemKey::Popularimeter) {
let trimmed = text.trim();
if let Ok(val) = trimmed.parse::<u16>() {
let clamped = val.min(100);
Expand All @@ -226,7 +226,7 @@ fn extract_rating(tag: &Tag) -> Option<u8> {
/// coalesced to `None` so the UI's "—" placeholder kicks in
/// instead of a blank cell.
fn extract_musical_key(tag: &Tag) -> Option<String> {
let raw = tag.get_string(&ItemKey::InitialKey)?;
let raw = tag.get_string(ItemKey::InitialKey)?;
let trimmed = raw.trim();
if trimmed.is_empty() {
None
Expand Down Expand Up @@ -277,7 +277,7 @@ fn extract_file(path: &Path, artwork_dir: &Path) -> Result<ExtractedFile, String
tag.artist().map(|s| s.into_owned()),
tag.album().map(|s| s.into_owned()),
tag.genre().map(|s| s.into_owned()),
tag.year().map(|y| y as i64),
tag.date().map(|d| d.year as i64),
tag.track().map(|n| n as i64),
tag.disk().map(|n| n as i64),
extract_cover(tag, artwork_dir),
Expand Down
Loading