Switching to C++ #60

Merged
kdeng00 merged 36 commits from experiment into master 2019-09-03 16:17:20 -04:00
2 changed files with 12 additions and 4 deletions
Showing only changes of commit d0d1008044 - Show all commits
+2
View File
@@ -174,6 +174,7 @@ std::vector<Song> songRepository::parseRecords(MYSQL_RES* results)
break;
case 7:
song.songPath = row[i];
break;
case 8:
song.coverArtId = std::stoi(row[i]);
break;
@@ -221,6 +222,7 @@ Song songRepository::parseRecord(MYSQL_RES* results)
break;
case 8:
song.coverArtId = std::stoi(row[i]);
break;
}
}
std::cout << "done parsing record" << std::endl;
+10 -4
View File
@@ -67,13 +67,19 @@ void song_manager::deleteSong(Song& song)
cov = covRepo.retrieveRecord(cov, coverFilter::id);
covRepo.deleteRecord(cov);
auto paths = directory_manager::pathConfigContent(exe_path);
const auto coverArtPath = paths["cover_root_path"].get<std::string>();
std::string stockCoverArtPath = coverArtPath;
stockCoverArtPath.append("CoverArt.png");
// TODO: only delete coverArt that is not the stock cover
// path
fs::remove(cov.imagePath);
if (stockCoverArtPath.compare(cov.imagePath) != 0) {
fs::remove(cov.imagePath);
std::cout << "deleting cover art" << std::endl;
}
fs::remove(song.songPath);
// TODO: delete empty directories
directory_manager::delete_directories(song, paths["root_music_path"].get<std::string>());
directory_manager::delete_directories(song, coverArtPath);
}
void song_manager::printSong(const Song& song)