Minor cleanup

This commit is contained in:
emeric
2016-09-24 16:40:17 +02:00
parent 3af320e42b
commit 50cd4ed131
6 changed files with 10 additions and 11 deletions
@@ -35,7 +35,7 @@ static Cluster::pointer getCluster(std::string type, std::string value)
return cluster; return cluster;
} }
static std::list<std::string> getClustersFromFeature(Feature::Type& feature, double minProb) static std::list<std::string> getClustersFromFeature(boost::property_tree::ptree& feature, double minProb)
{ {
struct HighLevelNodeDesc struct HighLevelNodeDesc
{ {
@@ -181,7 +181,7 @@ HighLevelCluster::handleFilesUpdated(void)
std::list<std::string> newClusterNames; std::list<std::string> newClusterNames;
if (createTags) if (createTags)
{ {
Feature::Type feature; boost::property_tree::ptree feature;
if (!Feature::Store::instance().get(UpdaterDboSession(), trackId, "high_level", feature)) if (!Feature::Store::instance().get(UpdaterDboSession(), trackId, "high_level", feature))
continue; continue;
+2 -1
View File
@@ -112,7 +112,8 @@ Extractor::getLowLevel(boost::property_tree::ptree& pt, std::string mbid)
return false; return false;
} }
res.erase("metadata"); // Keep metadata to ease debugging
// res.erase("metadata");
pt = res; pt = res;
-2
View File
@@ -25,8 +25,6 @@
namespace Feature { namespace Feature {
typedef boost::property_tree::ptree Type;
class Extractor class Extractor
{ {
public: public:
+2 -2
View File
@@ -62,7 +62,7 @@ Store::exists(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::
} }
bool bool
Store::get(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, Type& feature) Store::get(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, boost::property_tree::ptree& feature)
{ {
Wt::Dbo::Transaction transaction(session); Wt::Dbo::Transaction transaction(session);
@@ -94,7 +94,7 @@ Store::get(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::str
bool bool
Store::set(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, const Type& feature) Store::set(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, const boost::property_tree::ptree& feature)
{ {
Wt::Dbo::Transaction transaction(session); Wt::Dbo::Transaction transaction(session);
+3 -3
View File
@@ -20,9 +20,9 @@
#pragma once #pragma once
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <boost/property_tree/ptree.hpp>
#include "database/Types.hpp" #include "database/Types.hpp"
#include "FeatureExtractor.hpp"
namespace Feature { namespace Feature {
@@ -35,9 +35,9 @@ class Store
static Store& instance(); static Store& instance();
bool exists(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type); bool exists(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type);
bool get(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, Type& feature); bool get(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, boost::property_tree::ptree& feature);
bool set(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, const Type& feature); bool set(Wt::Dbo::Session& session, Database::Track::id_type trackId, std::string type, const boost::property_tree::ptree& feature);
private: private:
Store(); Store();
+1 -1
View File
@@ -23,9 +23,9 @@
#include <Wt/WServer> #include <Wt/WServer>
#include "utils/Config.hpp" #include "utils/Config.hpp"
#include "utils/Logger.hpp"
#include "av/AvInfo.hpp" #include "av/AvInfo.hpp"
#include "av/AvTranscoder.hpp" #include "av/AvTranscoder.hpp"
#include "utils/Logger.hpp"
#include "image/Image.hpp" #include "image/Image.hpp"
#include "feature/FeatureExtractor.hpp" #include "feature/FeatureExtractor.hpp"