diff options
Diffstat (limited to 'music.cpp')
-rw-r--r-- | music.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -9,6 +9,7 @@ #include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> +#include <boost/cast.hpp> #include <boost/filesystem/fstream.hpp> #include <soci/soci.h> @@ -51,6 +52,16 @@ MusicListing::p music::get(const std::string& path) { return get(path_vector); } +MusicDirectory::p music::get_directory(const std::string& path) { + MusicListing::p ml = get(path); + if(!ml || !fs::is_directory(ml->path)) { + return MusicDirectory::p(); + } + MusicDirectory::p dir(boost::dynamic_pointer_cast<MusicDirectory>(ml)); + + return dir; +} + std::vector<MusicListing::p> music::find_artist(const std::string artist) { soci::session sql(config::vm["audist.database"].as<std::string>()); |