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:
@@ -1,6 +1,7 @@
|
||||
#include "managers/coverArtManager.h"
|
||||
|
||||
#include "database/coverArtRepository.h"
|
||||
#include "types/coverFilter.h"
|
||||
#include "utilities/metadata_retriever.h"
|
||||
|
||||
coverArtManager::coverArtManager(const std::string& configPath) : path(configPath)
|
||||
@@ -16,6 +17,10 @@ Cover coverArtManager::saveCover(const Song& song, std::string& rootPath, const
|
||||
cov.songTitle = song.title;
|
||||
|
||||
coverArtRepository covRepo(path);
|
||||
std::cout << "saving record to the database" << std::endl;
|
||||
covRepo.saveRecord(cov);
|
||||
std::cout << "retrieving record from database" << std::endl;
|
||||
cov = covRepo.retrieveRecord(cov, coverFilter::songTitle);
|
||||
|
||||
return cov;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "database/songRepository.h"
|
||||
#include "managers/coverArtManager.h"
|
||||
#include "managers/directory_manager.h"
|
||||
#include "utilities/metadata_retriever.h"
|
||||
@@ -34,6 +35,10 @@ void song_manager::saveSong(Song& song)
|
||||
stockCoverPath.append("/CoverArt.png");
|
||||
|
||||
auto cov = covMgr.saveCover(song, coverRootPath, stockCoverPath);
|
||||
song.coverArtId = cov.id;
|
||||
|
||||
songRepository songRepo(exe_path);
|
||||
songRepo.saveRecord(song);
|
||||
}
|
||||
|
||||
void song_manager::printSong(const Song& song)
|
||||
|
||||
Reference in New Issue
Block a user