Added some profiling events for scanner
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "metadata/Exception.hpp"
|
||||
#include "utils/ILogger.hpp"
|
||||
#include "utils/IProfiler.hpp"
|
||||
#include "utils/String.hpp"
|
||||
|
||||
namespace MetaData
|
||||
@@ -169,12 +170,19 @@ namespace MetaData
|
||||
dst[tag] = std::move(values);
|
||||
}
|
||||
}
|
||||
|
||||
TagLib::FileRef parseFile(const std::filesystem::path& p, ParserReadStyle parserReadStyle)
|
||||
{
|
||||
LMS_SCOPED_PROFILE_DETAILED("MetaData", "TagLibParseFile");
|
||||
|
||||
return TagLib::FileRef{ p.string().c_str()
|
||||
, true // read audio properties
|
||||
, readStyleToTagLibReadStyle(parserReadStyle) };
|
||||
}
|
||||
}
|
||||
|
||||
TagLibTagReader::TagLibTagReader(const std::filesystem::path& p, ParserReadStyle parserReadStyle, bool debug)
|
||||
: _file{ p.string().c_str()
|
||||
, true // read audio properties
|
||||
, readStyleToTagLibReadStyle(parserReadStyle) }
|
||||
: _file{ parseFile(p, parserReadStyle) }
|
||||
{
|
||||
if (_file.isNull())
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace MetaData
|
||||
std::size_t getBitsPerSample() const override;
|
||||
std::size_t getSampleRate() const override;
|
||||
|
||||
TagLib::FileRef _file;
|
||||
const TagLib::FileRef _file;
|
||||
TagLib::PropertyMap _propertyMap; // case-insensitive keys
|
||||
bool _hasEmbeddedCover{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user