Added manager classes for song metadata

This commit is contained in:
kdeng00
2019-09-01 15:10:46 -04:00
parent d16b8dc3c9
commit f75ebe14a7
26 changed files with 127 additions and 36 deletions
View File
View File
+1 -1
View File
@@ -16,7 +16,7 @@ Model::Cover Manager::coverArtManager::saveCover(const Model::Song& song, std::s
cov = meta.update_cover_art(song, cov, stockCoverPath);
cov.songTitle = song.title;
coverArtRepository covRepo(path);
Database::coverArtRepository covRepo(path);
std::cout << "saving record to the database" << std::endl;
covRepo.saveRecord(cov);
std::cout << "retrieving record from database" << std::endl;
View File
+3 -3
View File
@@ -49,14 +49,14 @@ void Manager::song_manager::saveSong(Model::Song& song)
printSong(song);
songRepository songRepo(exe_path);
Database::songRepository songRepo(exe_path);
songRepo.saveRecord(song);
}
void Manager::song_manager::deleteSong(Model::Song& song)
{
coverArtRepository covRepo(exe_path);
songRepository songRepo(exe_path);
Database::coverArtRepository covRepo(exe_path);
Database::songRepository songRepo(exe_path);
song = songRepo.retrieveRecord(song, songFilter::id);
songRepo.deleteRecord(song);
+17
View File
@@ -104,6 +104,23 @@ Model::auth_credentials Manager::token_manager::parse_auth_credentials(std::stri
return auth;
}
Model::auth_credentials Manager::token_manager::parse_auth_credentials(const BinaryPath& bConf)
{
auto exePath = Manager::directory_manager::configPath(bConf);
exe_path.append("/auth_credentials.json");
auto con = Manager::directory_manager::credentialConfigContent(exePath);
Model::auth_credentials auth;
auth.uri = "https://";
auth.uri.append(con["domain"]);
auth.api_identifier = con["api_identifier"];
auth.client_id = con["client_id"];
auth.client_secret = con["client_secret"];
auth.endpoint = "oauth/token";
return auth;
}
std::vector<std::string> Manager::token_manager::extract_scopes(const jwt::decoded_jwt&& decoded)
{
View File