From e19efcb8e7ba2cf4d4ce59c5f76e78a41a19ba24 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 2 Jan 2011 03:55:52 +0100 Subject: Command handling changes as a result of adding the update command. --- music.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'music.cpp') diff --git a/music.cpp b/music.cpp index 6265771..9193b89 100644 --- a/music.cpp +++ b/music.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include fs::path music::root_directory; @@ -77,6 +78,21 @@ std::vector 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"); -- cgit v1.2.3