added flag to prevent the user from being prompted when uploading songs from a directory

This commit is contained in:
kdeng00
2019-11-12 22:07:44 -05:00
parent 996b84c25c
commit 7177b01a98
7 changed files with 90 additions and 47 deletions
+4 -4
View File
@@ -72,14 +72,14 @@ namespace Syncers
void Upload::uploadSongsFromDirectory(const Models::Token& token,
const std::string& directory,
bool recursive = false)
const bool noConfirm, bool recursive = false)
{
try
{
auto songs = retrieveAllSongsFromDirectory(directory, recursive);
auto confirmUpload = false;
auto confirmUpload = true;
while (true)
while (!noConfirm)
{
auto answer = 'a';
cout << "are you sure you want to upload " << songs.size() << " songs? [y/n]";
@@ -197,7 +197,7 @@ namespace Syncers
cout<<"Path: "<<song.songPath<<endl;
}
}
void Upload::printJsonData(json obj)
void Upload::printJsonData(const json& obj)
{
cout<<endl<<endl<<"JSon data: "<<endl;
cout<<"id: "<<obj["id"]<<endl;