Skip to content

Commit

Permalink
Default track name to file name instead of "Unknown" (fix #828)
Browse files Browse the repository at this point in the history
  • Loading branch information
martpie committed Feb 17, 2025
1 parent 6bb1295 commit ef10ace
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src-tauri/src/libs/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ pub fn get_track_from_file(path: &PathBuf) -> Option<Track> {
path: path.to_string_lossy().into_owned(),
title: tag
.get_string(&ItemKey::TrackTitle)
.unwrap_or("Unknown")
.unwrap_or(
path.file_name()
.and_then(|f| f.to_str())
.unwrap_or("Unknown"),
)
.to_string(),
album: tag
.get_string(&ItemKey::AlbumTitle)
Expand Down

0 comments on commit ef10ace

Please sign in to comment.