WIP. Database updater now has its own namespace and dedicated directory

This commit is contained in:
emeric
2014-07-01 23:43:49 +02:00
parent 7fd546eb44
commit 16d1194d61
35 changed files with 320 additions and 224 deletions
+10 -6
View File
@@ -651,6 +651,7 @@ int main()
{
try {
bool extendedTests = true;
bool writeCovers = false;
std::cout << "Running test... extendedTests = " << std::boolalpha << extendedTests << std::endl;
@@ -709,13 +710,16 @@ int main()
std::vector<Cover> coverArts;
client.getCoverRelease(coverArts, release.id);
boost::filesystem::create_directory("cover");
BOOST_FOREACH(const Cover coverArt, coverArts)
if (writeCovers)
{
std::ostringstream oss; oss << "cover/" << release.id << "." << release.name << ".jpeg";
std::ofstream out(oss.str().c_str());
BOOST_FOREACH(unsigned char c, coverArt.data)
out.put(c);
boost::filesystem::create_directory("cover");
BOOST_FOREACH(const Cover coverArt, coverArts)
{
std::ostringstream oss; oss << "cover/" << release.id << "." << release.name << ".jpeg";
std::ofstream out(oss.str().c_str());
BOOST_FOREACH(unsigned char c, coverArt.data)
out.put(c);
}
}
std::cout << "Release '" << release << "', spotted " << coverArts.size() << " covers!" << std::endl;