diff --git a/include/database/albumRepository.h b/include/database/albumRepository.h index d2b7be0..e9e9dfe 100644 --- a/include/database/albumRepository.h +++ b/include/database/albumRepository.h @@ -18,6 +18,8 @@ namespace Database Model::Album retrieveRecord(Model::Album&, Type::albumFilter); + bool doesAlbumExists(const Model::Album&, Type::albumFilter); + void saveAlbum(const Model::Album&); private: std::vector parseRecords(MYSQL_RES*); diff --git a/src/database/albumRepository.cpp b/src/database/albumRepository.cpp index 239a1ce..57b7190 100644 --- a/src/database/albumRepository.cpp +++ b/src/database/albumRepository.cpp @@ -53,6 +53,19 @@ Model::Album Database::albumRepository::retrieveRecord(Model::Album& album, Type return album; } +bool Database::albumRepository::doesAlbumExists(const Model::Album& album, Type::albumFilter filter) +{ + // TODO: continue working on this part. + // Reason: there should be a check to see if an album record already exists + // at the moment there is no check and every time a song is uploaded + // a new album record is created, even for songs that are on the + // same album. This should not happen. There should be one album + // record for songs on the same album. After fixing this, do the + // same for Artist, Genre, and Year records + + return false; +} + void Database::albumRepository::saveAlbum(const Model::Album& album) { std::cout << "beginning to insert album record" << std::endl;