TagFile: rename exported functions, use CamelCase

And specify whether generic tags are being scanned.
This commit is contained in:
Max Kellermann 2018-07-06 22:33:35 +02:00
parent 2c30e16371
commit 73c95d1fb2
5 changed files with 11 additions and 10 deletions

View File

@ -85,7 +85,7 @@ Song::UpdateFile(Storage &storage) noexcept
if (!tag_stream_scan(absolute_uri.c_str(), tag_builder))
return false;
} else {
if (!tag_file_scan(path_fs, tag_builder))
if (!ScanFileTagsWithGeneric(path_fs, tag_builder))
return false;
}
@ -149,7 +149,7 @@ DetachedSong::LoadFile(Path path) noexcept
return false;
TagBuilder tag_builder;
if (!tag_file_scan(path, tag_builder))
if (!ScanFileTagsWithGeneric(path, tag_builder))
return false;
mtime = fi.GetModificationTime();

View File

@ -81,7 +81,7 @@ public:
};
bool
tag_file_scan(Path path_fs, TagHandler &handler) noexcept
ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) noexcept
{
assert(!path_fs.IsNull());
@ -100,11 +100,11 @@ tag_file_scan(Path path_fs, TagHandler &handler) noexcept
}
bool
tag_file_scan(Path path, TagBuilder &builder) noexcept
ScanFileTagsWithGeneric(Path path, TagBuilder &builder) noexcept
{
FullTagHandler h(builder);
if (!tag_file_scan(path, h))
if (!ScanFileTagsNoGeneric(path, h))
return false;
if (builder.empty())

View File

@ -28,13 +28,14 @@ class TagBuilder;
/**
* Scan the tags of a song file. Invokes matching decoder plugins,
* but does not invoke the special "APE" and "ID3" scanners.
* but does not fall back to generic scanners (APE and ID3) if no tags
* were found (but the file was recognized).
*
* @return true if the file was recognized (even if no metadata was
* found)
*/
bool
tag_file_scan(Path path, TagHandler &handler) noexcept;
ScanFileTagsNoGeneric(Path path, TagHandler &handler) noexcept;
/**
* Scan the tags of a song file. Invokes matching decoder plugins,
@ -45,6 +46,6 @@ tag_file_scan(Path path, TagHandler &handler) noexcept;
* found)
*/
bool
tag_file_scan(Path path, TagBuilder &builder) noexcept;
ScanFileTagsWithGeneric(Path path, TagBuilder &builder) noexcept;
#endif

View File

@ -167,7 +167,7 @@ static CommandResult
read_file_comments(Response &r, const Path path_fs)
{
PrintCommentHandler h(r);
if (!tag_file_scan(path_fs, h)) {
if (!ScanFileTagsNoGeneric(path_fs, h)) {
r.Error(ACK_ERROR_NO_EXIST, "Failed to load file");
return CommandResult::ERROR;
}

View File

@ -99,7 +99,7 @@ embcue_playlist_open_uri(const char *uri,
const auto path_fs = AllocatedPath::FromUTF8Throw(uri);
ExtractCuesheetTagHandler extract_cuesheet;
tag_file_scan(path_fs, extract_cuesheet);
ScanFileTagsNoGeneric(path_fs, extract_cuesheet);
if (extract_cuesheet.cuesheet.empty())
ScanGenericTags(path_fs, extract_cuesheet);