Merge branch 'master' into support_new_upload_endpoint

This commit is contained in:
Kun Deng
2022-01-08 23:46:43 -05:00
committed by GitHub
35 changed files with 1815 additions and 1706 deletions
+9 -6
View File
@@ -5,12 +5,15 @@
namespace Models
{
struct API
{
std::string url;
std::string endpoint;
std::string version;
};
class API
{
public:
std::string url;
std::string endpoint;
std::string version;
};
}
#endif
+15 -6
View File
@@ -5,12 +5,21 @@
namespace Models
{
class Flags
{
public:
std::string flag;
std::string value;
};
class Flags
{
public:
std::string flag;
std::string value;
};
struct Flags
{
std::string flag;
std::string value;
};
}
#endif
+31 -29
View File
@@ -11,41 +11,43 @@
namespace Models
{
class IcarusAction
class IcarusAction
{
public:
std::string retrieveFlagValue(const std::string_view flag)
{
public:
std::string retrieveFlagValue(const std::string_view flag)
std::string value;
const auto fg = std::find_if(flags.begin(), flags.end(), [&](Flags f)
{
std::string value;
return f.flag.compare(flag) == 0 ? true : false;
});
const auto fg = std::find_if(flags.begin(), flags.end(), [&](Flags f)
{
return f.flag.compare(flag) == 0 ? true : false;
});
if (fg != flags.end())
{
value.assign(fg->value);
}
return value;
}
void print_action_and_flags() noexcept
if (fg != flags.end())
{
std::cout<<"Action: "<<this->action<<"\n";
std::cout<<"Flag count: "<<this->flags.size()<<"\n";
for (const auto &flag : this->flags)
{
std::cout<<"flag "<<flag.flag<<" value "<<flag.value<<"\n";
}
std::cout<<"\n";
value.assign(fg->value);
}
std::string action;
std::vector<Flags> flags;
};
return value;
}
void print_action_and_flags() noexcept
{
std::cout<<"Action: "<<this->action<<"\n";
std::cout<<"Flag count: "<<this->flags.size()<<"\n";
for (const auto &flag : this->flags)
{
std::cout<<"flag "<<flag.flag<<" value "<<flag.value<<"\n";
}
std::cout<<"\n";
}
std::string action;
std::vector<Flags> flags;
};
}
#endif
+31 -29
View File
@@ -7,40 +7,42 @@
namespace Models
{
class Song
class Song
{
public:
Song() = default;
void printInfo()
{
public:
Song() = default;
std::cout<<"Title: "<<this->title<<"\n";
std::cout<<"\n";
}
void printInfo()
{
std::cout<<"Title: "<<this->title<<"\n";
std::cout<<"\n";
}
std::string toMetadataJson();
std::string toMetadataJson();
int id;
std::string title;
std::string artist;
std::string album;
std::string genre;
int year;
int duration;
int track;
int disc;
std::string data;
std::string songPath;
};
int id;
std::string title;
std::string artist;
std::string album;
std::string genre;
int year;
int duration;
int track;
int disc;
std::string data;
std::string songPath;
};
class CoverArt
{
public:
int id;
std::string title;
std::string path;
};
class CoverArt
{
public:
int id;
std::string title;
std::string path;
};
}
#endif
+8 -6
View File
@@ -5,12 +5,14 @@
namespace Models
{
struct Token
{
std::string accessToken;
std::string tokenType;
int expiration;
};
struct Token
{
std::string accessToken;
std::string tokenType;
int expiration;
};
}
#endif
+7 -5
View File
@@ -6,11 +6,13 @@
namespace Models
{
struct UploadForm
{
std::string url;
std::string filePath;
};
struct UploadForm
{
std::string url;
std::string filePath;
};
}
#endif
+7 -5
View File
@@ -5,11 +5,13 @@
namespace Models
{
struct User
{
std::string username;
std::string password;
};
struct User
{
std::string username;
std::string password;
};
}
#endif