Updated clang format, and restored dsd file handling that was actually broken
This commit is contained in:
@@ -47,8 +47,8 @@ namespace lms::artwork
|
||||
}
|
||||
|
||||
ArtworkService::ArtworkService(db::IDb& db,
|
||||
const std::filesystem::path& defaultReleaseCoverSvgPath,
|
||||
const std::filesystem::path& defaultArtistImageSvgPath)
|
||||
const std::filesystem::path& defaultReleaseCoverSvgPath,
|
||||
const std::filesystem::path& defaultArtistImageSvgPath)
|
||||
: _db{ db }
|
||||
, _audioFileParser{ metadata::createAudioFileParser(metadata::AudioFileParserParameters{}) }
|
||||
, _cache{ core::Service<core::IConfig>::get()->getULong("cover-max-cache-size", 30) * 1000 * 1000 }
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace lms::auth
|
||||
virtual bool checkUserPassword(std::string_view loginName, std::string_view password) = 0;
|
||||
|
||||
CheckResult checkUserPassword(const boost::asio::ip::address& clientAddress,
|
||||
std::string_view loginName,
|
||||
std::string_view password) override;
|
||||
std::string_view loginName,
|
||||
std::string_view password) override;
|
||||
|
||||
std::shared_mutex _mutex;
|
||||
LoginThrottler _loginThrottler;
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace lms::auth
|
||||
db::UserId userId{};
|
||||
};
|
||||
virtual CheckResult checkUserPassword(const boost::asio::ip::address& clientAddress,
|
||||
std::string_view loginName,
|
||||
std::string_view password)
|
||||
std::string_view loginName,
|
||||
std::string_view password)
|
||||
= 0;
|
||||
|
||||
virtual bool canSetPasswords() const = 0;
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace lms::recommendation
|
||||
FeatureNames res;
|
||||
|
||||
std::transform(std::cbegin(featureDefinitions), std::cend(featureDefinitions),
|
||||
std::inserter(res, std::begin(res)), [](auto itFeature) { return itFeature.first; });
|
||||
std::inserter(res, std::begin(res)), [](auto itFeature) { return itFeature.first; });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -101,10 +101,10 @@ namespace lms::recommendation
|
||||
|
||||
std::unordered_set<FeatureName> featureNames;
|
||||
std::transform(std::cbegin(trainSettings.featureSettingsMap), std::cend(trainSettings.featureSettingsMap), std::inserter(featureNames, std::begin(featureNames)),
|
||||
[](const auto& itFeatureSetting) { return itFeatureSetting.first; });
|
||||
[](const auto& itFeatureSetting) { return itFeatureSetting.first; });
|
||||
|
||||
const std::size_t nbDimensions{ std::accumulate(std::cbegin(featureNames), std::cend(featureNames), std::size_t{ 0 },
|
||||
[](std::size_t sum, const FeatureName& featureName) { return sum + getFeatureDef(featureName).nbDimensions; }) };
|
||||
[](std::size_t sum, const FeatureName& featureName) { return sum + getFeatureDef(featureName).nbDimensions; }) };
|
||||
|
||||
LMS_LOG(RECOMMENDATION, DEBUG, "Features dimension = " << nbDimensions);
|
||||
|
||||
@@ -184,8 +184,8 @@ namespace lms::recommendation
|
||||
|
||||
LMS_LOG(RECOMMENDATION, DEBUG, "Training network...");
|
||||
network.train(samples, trainSettings.iterationCount,
|
||||
progressCallback ? somProgressCallback : som::Network::ProgressCallback{},
|
||||
[this] { return _loadCancelled; });
|
||||
progressCallback ? somProgressCallback : som::Network::ProgressCallback{},
|
||||
[this] { return _loadCancelled; });
|
||||
LMS_LOG(RECOMMENDATION, DEBUG, "Training network DONE");
|
||||
|
||||
LMS_LOG(RECOMMENDATION, DEBUG, "Classifying tracks...");
|
||||
@@ -242,10 +242,10 @@ namespace lms::recommendation
|
||||
auto transaction{ session.createReadTransaction() };
|
||||
|
||||
similarTrackIds.erase(std::remove_if(std::begin(similarTrackIds), std::end(similarTrackIds),
|
||||
[&](TrackId trackId) {
|
||||
return !Track::exists(session, trackId);
|
||||
}),
|
||||
std::end(similarTrackIds));
|
||||
[&](TrackId trackId) {
|
||||
return !Track::exists(session, trackId);
|
||||
}),
|
||||
std::end(similarTrackIds));
|
||||
}
|
||||
|
||||
return similarTrackIds;
|
||||
@@ -263,10 +263,10 @@ namespace lms::recommendation
|
||||
auto transaction{ session.createReadTransaction() };
|
||||
|
||||
similarReleaseIds.erase(std::remove_if(std::begin(similarReleaseIds), std::end(similarReleaseIds),
|
||||
[&](ReleaseId releaseId) {
|
||||
return !Release::exists(session, releaseId);
|
||||
}),
|
||||
std::end(similarReleaseIds));
|
||||
[&](ReleaseId releaseId) {
|
||||
return !Release::exists(session, releaseId);
|
||||
}),
|
||||
std::end(similarReleaseIds));
|
||||
}
|
||||
|
||||
return similarReleaseIds;
|
||||
@@ -302,10 +302,10 @@ namespace lms::recommendation
|
||||
auto transaction{ session.createReadTransaction() };
|
||||
|
||||
res.erase(std::remove_if(std::begin(res), std::end(res),
|
||||
[&](ArtistId artistId) {
|
||||
return !Artist::exists(session, artistId);
|
||||
}),
|
||||
std::end(res));
|
||||
[&](ArtistId artistId) {
|
||||
return !Artist::exists(session, artistId);
|
||||
}),
|
||||
std::end(res));
|
||||
}
|
||||
|
||||
while (res.size() > maxCount)
|
||||
|
||||
@@ -101,9 +101,9 @@ namespace lms::recommendation
|
||||
|
||||
template<typename IdType>
|
||||
std::vector<IdType> getSimilarObjects(const std::vector<IdType>& ids,
|
||||
const ObjectMatrix<IdType>& objectMatrix,
|
||||
const ObjectPositions<IdType>& objectPositions,
|
||||
std::size_t maxCount) const;
|
||||
const ObjectMatrix<IdType>& objectMatrix,
|
||||
const ObjectPositions<IdType>& objectPositions,
|
||||
std::size_t maxCount) const;
|
||||
|
||||
db::IDb& _db;
|
||||
bool _loadCancelled{};
|
||||
@@ -157,9 +157,9 @@ namespace lms::recommendation
|
||||
|
||||
template<typename IdType>
|
||||
std::vector<IdType> FeaturesEngine::getSimilarObjects(const std::vector<IdType>& ids,
|
||||
const ObjectMatrix<IdType>& objectMatrix,
|
||||
const ObjectPositions<IdType>& objectPositions,
|
||||
std::size_t maxCount) const
|
||||
const ObjectMatrix<IdType>& objectMatrix,
|
||||
const ObjectPositions<IdType>& objectPositions,
|
||||
std::size_t maxCount) const
|
||||
{
|
||||
std::vector<IdType> res;
|
||||
|
||||
@@ -173,10 +173,10 @@ namespace lms::recommendation
|
||||
|
||||
// Remove objects that are already in input or already reported
|
||||
closestObjectIds.erase(std::remove_if(std::begin(closestObjectIds), std::end(closestObjectIds),
|
||||
[&](IdType id) {
|
||||
return std::find(std::cbegin(ids), std::cend(ids), id) != std::cend(ids);
|
||||
}),
|
||||
std::end(closestObjectIds));
|
||||
[&](IdType id) {
|
||||
return std::find(std::cbegin(ids), std::cend(ids), id) != std::cend(ids);
|
||||
}),
|
||||
std::end(closestObjectIds));
|
||||
|
||||
for (IdType id : closestObjectIds)
|
||||
{
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace lms::recommendation::PlaylistGeneratorConstraint
|
||||
ArtistContainer intersection;
|
||||
|
||||
std::set_intersection(std::cbegin(artists1), std::cend(artists1),
|
||||
std::cbegin(artists2), std::cend(artists2),
|
||||
std::back_inserter(intersection));
|
||||
std::cbegin(artists2), std::cend(artists2),
|
||||
std::back_inserter(intersection));
|
||||
|
||||
return intersection.size();
|
||||
}
|
||||
|
||||
@@ -591,9 +591,9 @@ namespace lms::scanner
|
||||
// Skip if duplicate files no longer in media root: as it will be removed later, we will end up with no file
|
||||
auto& mediaLibraries{ getScannerSettings().mediaLibraries };
|
||||
if (std::none_of(std::cbegin(mediaLibraries), std::cend(mediaLibraries),
|
||||
[&](const MediaLibraryInfo& libraryInfo) {
|
||||
return core::pathUtils::isPathInRootPath(getFilePath(), libraryInfo.rootDirectory, &excludeDirFileName);
|
||||
}))
|
||||
[&](const MediaLibraryInfo& libraryInfo) {
|
||||
return core::pathUtils::isPathInRootPath(getFilePath(), libraryInfo.rootDirectory, &excludeDirFileName);
|
||||
}))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -246,10 +246,10 @@ namespace lms::scanner
|
||||
std::vector<std::string> res;
|
||||
|
||||
core::Service<core::IConfig>::get()->visitStrings("artist-image-file-names",
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "artist" });
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "artist" });
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -259,10 +259,10 @@ namespace lms::scanner
|
||||
std::vector<std::string> res;
|
||||
|
||||
core::Service<core::IConfig>::get()->visitStrings("artist-info-image-file-names",
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "thumb", "folder", "fanart" });
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "thumb", "folder", "fanart" });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -175,10 +175,10 @@ namespace lms::scanner
|
||||
std::vector<std::string> res;
|
||||
|
||||
core::Service<core::IConfig>::get()->visitStrings("medium-image-file-names",
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "discsubtitle" });
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "discsubtitle" });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -204,10 +204,10 @@ namespace lms::scanner
|
||||
std::vector<std::string> res;
|
||||
|
||||
core::Service<core::IConfig>::get()->visitStrings("cover-preferred-file-names",
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "cover", "front", "folder", "default" });
|
||||
[&res](std::string_view fileName) {
|
||||
res.emplace_back(fileName);
|
||||
},
|
||||
{ "cover", "front", "folder", "default" });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -101,9 +101,9 @@ namespace lms::scanner
|
||||
}
|
||||
|
||||
if (std::none_of(std::cbegin(_settings.mediaLibraries), std::cend(_settings.mediaLibraries),
|
||||
[&](const MediaLibraryInfo& libraryInfo) {
|
||||
return core::pathUtils::isPathInRootPath(p, libraryInfo.rootDirectory, &excludeDirFileName);
|
||||
}))
|
||||
[&](const MediaLibraryInfo& libraryInfo) {
|
||||
return core::pathUtils::isPathInRootPath(p, libraryInfo.rootDirectory, &excludeDirFileName);
|
||||
}))
|
||||
{
|
||||
LMS_LOG(DBUPDATER, DEBUG, "Removing " << p << ": out of media directory");
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace lms::transcoding
|
||||
|
||||
private:
|
||||
Wt::Http::ResponseContinuation* processRequest(const Wt::Http::Request& request, Wt::Http::Response& response) override;
|
||||
void abort() override{};
|
||||
void abort() override {};
|
||||
|
||||
static constexpr std::size_t _chunkSize{ 262'144 };
|
||||
std::optional<std::size_t> _estimatedContentLength;
|
||||
|
||||
Reference in New Issue
Block a user