Ready for release

This commit is contained in:
kdeng00
2022-01-09 18:06:43 -05:00
parent c8e8c1a460
commit d9962749c8
5 changed files with 80 additions and 25 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ using Managers::CommitManager;
constexpr static auto IcarusDownloadManager_version()
{
return "v0.1.2";
return "v0.2.0";
}
void printHelp()
+23 -16
View File
@@ -1,23 +1,23 @@
#include"Managers/CommitManager.h"
#include<iostream>
#include<fstream>
#include<sstream>
#include<filesystem>
#include <iostream>
#include <fstream>
#include <sstream>
#include <filesystem>
#include"nlohmann/json.hpp"
#include "nlohmann/json.hpp"
#include"Models/API.h"
#include"Models/Song.h"
#include"Models/Token.h"
#include"Parsers/APIParser.h"
#include"Syncers/Delete.h"
#include"Syncers/Download.h"
#include"Syncers/RetrieveRecords.h"
#include"Syncers/Upload.h"
#include "Models/API.h"
#include "Models/Song.h"
#include "Models/Token.h"
#include "Parsers/APIParser.h"
#include "Syncers/Delete.h"
#include "Syncers/Download.h"
#include "Syncers/RetrieveRecords.h"
#include "Syncers/Upload.h"
#include"Managers/TokenManager.h"
#include"Managers/UserManager.h"
#include "Managers/TokenManager.h"
#include "Managers/UserManager.h"
using std::cout;
using std::endl;
@@ -308,7 +308,9 @@ void CommitManager::singTargetUpload(const std::string &songPath, const std::str
}
song = *sng;
song.songPath = songPath;
const auto p = fs::path(songPath);
song.directory = p.parent_path.string();
song.generate_filename_from_track();
Models::CoverArt cover;
cover.title = song.title;
@@ -363,6 +365,8 @@ void CommitManager::multiTargetUpload(const std::string &sourcePath)
}
auto album = retrieveMetadata(metadataPath);
songs.clear();
songs.assign(album.songs.begin(), album.songs.end());
Upload up(api, token);
@@ -399,6 +403,9 @@ CommitManager::Album CommitManager::retrieveMetadata(const std::string_view path
song.album = album.album;
song.year = album.year;
song.genre = album.genre;
song.generate_filename_from_track();
const auto p = fs::path(path);
song.directory = p.parent_path().string();
album.songs.push_back(song);
}
+3 -2
View File
@@ -112,7 +112,7 @@ void Upload::uploadSongWithMetadata(Managers::CommitManager::Album &album, Model
{
auto url = retrieveUrl();
cout<<"url "<<url<<endl;
cout << "url " << url << "\n";
string auth(this->m_token.tokenType);
auth.append(" " + this->m_token.accessToken);
@@ -131,10 +131,11 @@ void Upload::uploadSongWithMetadata(Managers::CommitManager::Album &album, Model
const auto meta = s.dump();
cout<<"\n\nMeta:\n"<<meta<<"\n";
cout << "Filepath: " << song.song_path() << "\n";
auto multipart = cpr::Multipart{{"cover", cpr::File{cover.path}},
{"metadata", meta},
{"file", cpr::File{song.songPath}}};
{"file", cpr::File{song.song_path()}}};
auto r = cpr::Post(cpr::Url{url}, multipart,
cpr::Header{{"authorization", auth}}