Improve handing of tracks with missing titles

custom
jacqueline 1 year ago
parent cb0c42060b
commit a37b517356
  1. 3
      src/audio/fatfs_audio_input.cpp
  2. 2
      src/database/track.cpp

@ -111,6 +111,9 @@ auto FatfsAudioInput::OpenFile(const std::string& path) -> bool {
ESP_LOGE(kTag, "failed to read tags");
return false;
}
if (!tags->title()) {
tags->title(path);
}
auto stream_type = ContainerToStreamType(tags->encoding());
if (!stream_type.has_value()) {

@ -302,6 +302,6 @@ auto Track::TitleOrFilename() const -> std::pmr::string {
if (start == std::pmr::string::npos) {
return data().filepath;
}
return data().filepath.substr(start);
return data().filepath.substr(start + 1);
}
} // namespace database

Loading…
Cancel
Save