Improve handing of tracks with missing titles

This commit is contained in:
jacqueline
2024-02-12 17:08:19 +11:00
parent cb0c42060b
commit a37b517356
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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()) {
+1 -1
View File
@@ -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