summaryrefslogtreecommitdiff
path: root/music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'music.cpp')
-rw-r--r--music.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/music.cpp b/music.cpp
index 772ae9c..6265771 100644
--- a/music.cpp
+++ b/music.cpp
@@ -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>());