Improve handing of tracks with missing titles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user