Made progress

This commit is contained in:
kdeng00
2021-12-31 19:09:31 -05:00
parent 9930aab985
commit 14d3c9acc6
10 changed files with 296 additions and 59 deletions
+52 -2
View File
@@ -2,11 +2,14 @@
#define COMMITMANAGER_H_
#include<map>
#include<iostream>
#include<string>
#include<string_view>
#include"Models/API.h"
#include"Models/Token.h"
#include"Models/IcarusAction.h"
#include"Models/Song.h"
#include"Models/Token.h"
namespace Managers
{
@@ -22,6 +25,24 @@ namespace Managers
songs
};
// Used for parsing songs from the metadata file
class Album
{
public:
Album() = default;
void printInfo();
std::string album;
std::string albumArtist;
std::string genre;
int year;
int trackCount;
int discCount;
std::vector<Models::Song> songs;
};
private:
enum class ActionValues;
@@ -33,15 +54,44 @@ namespace Managers
void downloadSong();
void retrieveObjects();
void uploadSong();
// Uploads a single song. The song is constructed from a metadata file that contains
// information about the album the song is from. Also, the cover art of the song must
// be present.
//
// Expects
// * Song - mp3 file path
// * Metadata - Source file containing metadata of the song
// * Cover art - path to image cover art
void uploadSingleSong();
// Checks for the no confirm flag. Used when uploading songs from a directory
bool checkForNoConfirm()
{
for (const auto &arg: this->icaAction.flags)
{
if (arg.flag.compare("-nc") == 0)
{
return true;
}
}
return false;
}
Album retrieveMetadata(const std::string_view path);
std::string retrieveFileContent(const std::string_view path);
enum class ActionValues
{
deleteAct,
downloadAct,
retrieveAct,
uploadAct
uploadAct,
UPLOAD_SONG_WITH_METADATA // Uploads the song with metadata, including cover art
};
Models::IcarusAction icaAction;
};
}