db/simple: add an AudioFormat to each Song
This commit is contained in:
@@ -77,19 +77,23 @@ Song::UpdateFile(Storage &storage) noexcept
|
||||
return false;
|
||||
|
||||
TagBuilder tag_builder;
|
||||
auto new_audio_format = AudioFormat::Undefined();
|
||||
|
||||
const auto path_fs = storage.MapFS(relative_uri.c_str());
|
||||
if (path_fs.IsNull()) {
|
||||
const auto absolute_uri =
|
||||
storage.MapUTF8(relative_uri.c_str());
|
||||
if (!tag_stream_scan(absolute_uri.c_str(), tag_builder))
|
||||
if (!tag_stream_scan(absolute_uri.c_str(), tag_builder,
|
||||
&new_audio_format))
|
||||
return false;
|
||||
} else {
|
||||
if (!ScanFileTagsWithGeneric(path_fs, tag_builder))
|
||||
if (!ScanFileTagsWithGeneric(path_fs, tag_builder,
|
||||
&new_audio_format))
|
||||
return false;
|
||||
}
|
||||
|
||||
mtime = info.mtime;
|
||||
audio_format = new_audio_format;
|
||||
tag_builder.Commit(tag);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user