summaryrefslogtreecommitdiff
path: root/music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'music.cpp')
-rw-r--r--music.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/music.cpp b/music.cpp
index 6265771..9193b89 100644
--- a/music.cpp
+++ b/music.cpp
@@ -11,6 +11,7 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/cast.hpp>
#include <boost/filesystem/fstream.hpp>
+#include <boost/foreach.hpp>
#include <soci/soci.h>
fs::path music::root_directory;
@@ -77,6 +78,21 @@ std::vector<MusicListing::p> music::find_artist(const std::string artist) {
return results;
}
+void music::begin_update(const std::string path) {
+ MusicDirectory::p dir = get_directory(path);
+ std::cout << boost::format("updater(%s) called") % path << std::endl;
+ if(dir) {
+ update(dir->path);
+ }
+}
+
+void music::update(const MusicDirectory& dir) {
+ BOOST_FOREACH(fs::path t, dir.tracks) {
+ std::cout << "track " << t << std::endl;
+ }
+ std::for_each(dir.directories.begin(), dir.directories.end(), update);
+}
+
void MusicDirectory::render(HTTP::Connection::p req, HTTPResponse& res) {
res.add_header("content-type", "text/html");