Able to save song and cover art to the appropriate paths. Next is saving it to the database

This commit is contained in:
kdeng00
2019-08-22 22:40:49 -04:00
parent 592853695d
commit 764185da7d
17 changed files with 235 additions and 111 deletions
+1
View File
@@ -10,6 +10,7 @@
class base_repository
{
public:
protected:
MYSQL* setup_mysql_connection(database_connection);
MYSQL_RES* perform_mysql_query(MYSQL*, const std::string&);
+14
View File
@@ -0,0 +1,14 @@
#ifndef COVERARTREPOSITORY_H_
#define COVERARTREPOSITORY_H_
#include <mysql/mysql.h>
#include "models/models.h"
class coverArtRepository
{
public:
private:
};
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef SONGREPOSITORY_H_
#define SONGREPOSITORY_H_
#include <mysql/mysql.h>
#include "models/models.h"
class songRespository
{
public:
private:
};
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef COVERARTMANAGER_H_
#define COVERARTMANAGER_H_
#include "models/models.h"
class coverArtManager
{
public:
Cover saveCover(const Song&, std::string&, const std::string&);
private:
};
#endif
+12 -3
View File
@@ -2,6 +2,9 @@
#define DIRECTORY_MANAGER_H_
#include <string>
#include <string_view>
#include <nlohmann/json.hpp>
#include "models/models.h"
@@ -10,12 +13,18 @@ class directory_manager
public:
std::string create_directory_process(Song, const std::string&);
static std::string configPath(std::string_view);
static std::string contentOfPath(std::string_view);
static nlohmann::json credentialConfigContent(const std::string&);
static nlohmann::json databaseConfigContent(const std::string&);
static nlohmann::json pathConfigContent(const std::string&);
// Return Cover instead
std::string read_cover_art(const std::string&);
//std::string read_cover_art(const std::string&);
void copy_stock_to_root(const std::string&, const std::string&);
void copy_song_to_path(const std::string&, const std::string&);
//void copy_stock_to_root(const std::string&, const std::string&);
//void copy_song_to_path(const std::string&, const std::string&);
void delete_cover_art_file(const std::string&, const std::string&);
void delete_directories(Song, const std::string&);
+13
View File
@@ -4,6 +4,8 @@
#include <iostream>
#include <string>
#include <nlohmann/json.hpp>
#include "models/models.h"
class song_manager
@@ -11,8 +13,19 @@ class song_manager
public:
song_manager(std::string&);
/**
std::string retrieveMusicPath();
std::string retrieveTempPath();
*/
//nlohmann::json pathConfigContent();
void saveSong(Song&);
static void printSong(const Song&);
private:
void saveSongTemp(Song&);
std::string exe_path;
};
+1 -1
View File
@@ -10,7 +10,7 @@ class metadata_retriever
{
public:
Song retrieve_metadata(std::string&);
Cover update_cover_art(Cover, const Song, const std::string&);
Cover update_cover_art(const Song&, Cover& cov, const std::string&);
void update_metadata(Song updated_song, const Song old_song);
private: