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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,6 +15,7 @@ struct Song
|
||||
int duration;
|
||||
std::string songPath;
|
||||
std::vector<unsigned char> data;
|
||||
int coverArtId;
|
||||
};
|
||||
|
||||
struct Cover
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef COVERFILTER_H_
|
||||
#define COVERFILTER_H_
|
||||
|
||||
enum class coverFilter
|
||||
{
|
||||
id = 0,
|
||||
songTitle,
|
||||
imagePath
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef SONGFILTER_H_
|
||||
#define SONGFILTER_H_
|
||||
|
||||
enum class songFilter
|
||||
{
|
||||
id = 0,
|
||||
title,
|
||||
album,
|
||||
artist,
|
||||
genre,
|
||||
year
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user