Add code to add track to DB and remove old ones that are gone. Added fingerprint lib to link for id-ing tracks. Make sure DB is logical after these changes. Change music path due to complaints I don't quite understand.

This commit is contained in:
Kevin Whitaker
2017-01-30 22:48:13 -05:00
parent 50f30d494f
commit 83efc750eb
6 changed files with 99 additions and 7 deletions

View File

@@ -26,6 +26,7 @@
#include <thread>
#include "db/User.h"
#include "db/AudioTrack.h"
#include <groove/groove.h>
#include <experimental/filesystem> //TODO:Change to non-gcc way when officially using c++17
namespace std {
namespace filesystem = experimental::filesystem;
@@ -37,7 +38,7 @@ public:
static std::filesystem::path musicScanDir;
static GroovePlayer* getInstance() {
static GroovePlayer instance("music.db");
musicScanDir = std::filesystem::current_path().string()+"/music";
musicScanDir = std::filesystem::path("music");
return &instance;
};
GroovePlayer(GroovePlayer const&) = delete;
@@ -54,6 +55,7 @@ private:
std::thread* grooveAudioScanner;
static void grooveAudioScannerLoop();
static bool addFileToTrackDBIfTagged(std::filesystem::path file);
static void removeOrphanedTracks();
};