Added feature to upload all songs from a directory (optional recursive). Need to document the use of it as well as how to even use this CLI

This commit is contained in:
kdeng00
2019-10-23 20:48:42 -04:00
parent 27aecc7a0d
commit 81892cc52e
11 changed files with 162 additions and 29 deletions
+12 -1
View File
@@ -1,7 +1,9 @@
#ifndef UPLOAD_H_
#define UPLOAD_H_
#include<filesystem>
#include<string>
#include<vector>
#include<nlohmann/json.hpp>
@@ -11,6 +13,8 @@
#include"Models/Token.h"
#include"Models/UploadForm.h"
namespace fs = std::filesystem;
namespace Syncers
{
@@ -20,15 +24,22 @@ namespace Syncers
Upload();
Upload(Models::API);
void uploadSong(const Models::Token, Models::Song);
Models::Song uploadSong(const Models::Token&, Models::Song&);
void uploadSongsFromDirectory(const Models::Token&, const std::string&, bool);
private:
Managers::FileManager fMgr;
Models::API api;
Models::Song song;
std::vector<Models::Song> retrieveAllSongsFromDirectory(const std::string&,
bool);
std::string retrieveUrl();
Models::Song retrieveSongPath(fs::directory_entry&);
void printSongDetails();
void printSongDetails(std::vector<Models::Song>&);
void printJsonData(nlohmann::json);
};
}