Added albumArtist field memeber to Song model. Automatically apply disc value 1 for song's metadata that have an empty disc field. Switched from TagLib::FileRef to TagLib::MPEG::File

This commit is contained in:
kdeng00
2019-11-04 22:26:03 -05:00
parent c7bbdfe581
commit 9b4a0db67a
16 changed files with 236 additions and 231 deletions
+8 -3
View File
@@ -1,6 +1,7 @@
#ifndef ALBUMREPOSITORY_H_
#define ALBUMREPOSITORY_H_
#include <memory>
#include <utility>
#include <vector>
@@ -30,9 +31,13 @@ namespace database
std::pair<model::Album, int> parseRecordWithSongCount(MYSQL_STMT*);
// TODO: after parseRecord(MYSQL_STMT*) is implemented remove
// parseRecord(MYSQL_RES*)
model::Album parseRecord(MYSQL_RES*);
std::shared_ptr<MYSQL_BIND> valueBind(model::Album&,
std::tuple<char*, char*>&);
std::shared_ptr<MYSQL_BIND> valueBindWithSongCount(model::Album&,
std::tuple<char*, char*>&, int&);
std::tuple<char*, char*> metadataBuffer();
model::Album parseRecord(MYSQL_STMT*);
};
}
+2 -3
View File
@@ -16,7 +16,6 @@ namespace database
class SongRepository : public BaseRepository
{
public:
SongRepository(const std::string&);
SongRepository(const model::BinaryPath&);
std::vector<model::Song> retrieveRecords();
@@ -30,9 +29,9 @@ namespace database
void updateRecord(const model::Song&);
private:
std::shared_ptr<MYSQL_BIND> valueBind(model::Song&,
std::tuple<char*, char*, char*, char*, char*>&);
std::tuple<char*, char*, char*, char*, char*, char*>&);
std::tuple<char*, char*, char*, char*, char*> metadataBuffer();
std::tuple<char*, char*, char*, char*, char*, char*> metadataBuffer();
std::vector<model::Song> parseRecords(MYSQL_STMT*);