Cover art record saved in the database. Next is to save the song record to the database and then try to download the song afterwards

This commit is contained in:
kdeng00
2019-08-24 18:41:01 -04:00
parent 9281293fad
commit 1db3eb2f8c
11 changed files with 205 additions and 9 deletions
+4
View File
@@ -5,14 +5,18 @@
#include "database/base_repository.h"
#include "models/models.h"
#include "types/coverFilter.h"
class coverArtRepository : public base_repository
{
public:
coverArtRepository(const std::string&);
Cover retrieveRecord(Cover&, coverFilter);
void saveRecord(const Cover&);
private:
Cover parseRecord(MYSQL_RES*);
};
#endif
+12 -1
View File
@@ -1,14 +1,25 @@
#ifndef SONGREPOSITORY_H_
#define SONGREPOSITORY_H_
#include <vector>
#include <mysql/mysql.h>
#include "database/base_repository.h"
#include "models/models.h"
#include "types/songFilter.h"
class songRespository
class songRepository : public base_repository
{
public:
songRepository(const std::string&);
Song retrieveRecord(Song&, songFilter);
void saveRecord(const Song&);
private:
std::vector<Song> parseRecords(MYSQL_RES*);
Song parseRecord(MYSQL_RES*);
};
#endif
+1
View File
@@ -15,6 +15,7 @@ struct Song
int duration;
std::string songPath;
std::vector<unsigned char> data;
int coverArtId;
};
struct Cover
+11
View File
@@ -0,0 +1,11 @@
#ifndef COVERFILTER_H_
#define COVERFILTER_H_
enum class coverFilter
{
id = 0,
songTitle,
imagePath
};
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef SONGFILTER_H_
#define SONGFILTER_H_
enum class songFilter
{
id = 0,
title,
album,
artist,
genre,
year
};
#endif