Finally got around to adding the song downloading functionality

This commit is contained in:
kdeng00
2020-01-06 22:13:52 -05:00
parent 2fce9e7e19
commit 1fa7df4aa2
7 changed files with 87 additions and 41 deletions
+11 -1
View File
@@ -183,11 +183,21 @@ namespace repository {
m_tableName = songTable();
}
template<typename Str = std::string>
SongRepository(const Str& val) {
m_tableName = songTable();
if (!databaseExist(val)) {
initializedDatabase(val);
}
if (!doesTableExist(val)) {
createSongTable(val);
}
}
std::vector<Song> retrieveAllSongs(const std::string& appPath) {
std::vector<Song> downloadedSongs;
try {
// TODO: left off here
const auto dbPath = pathOfDatabase(appPath);
SQLite::Database db(dbPath, SQLite::OPEN_READONLY);