From e5d119d34354828f85d3562ca18fadfd1ce226f4 Mon Sep 17 00:00:00 2001 From: Kun Deng Date: Sun, 28 Aug 2022 10:34:27 -0400 Subject: [PATCH 1/3] Bug fix --- IcarusDownloadManager.vcxproj | 2 + IcarusDownloadManager.vcxproj.filters | 120 ++++++++++++++++++++++++++ IcarusDownloadManager.vcxproj.user | 11 +++ include/Managers/CommitManager.h | 15 ++-- include/Utilities/Checks.h | 4 +- src/Managers/CommitManager.cpp | 14 ++- 6 files changed, 157 insertions(+), 9 deletions(-) create mode 100644 IcarusDownloadManager.vcxproj.filters create mode 100644 IcarusDownloadManager.vcxproj.user diff --git a/IcarusDownloadManager.vcxproj b/IcarusDownloadManager.vcxproj index 7fa6cf8..c293858 100644 --- a/IcarusDownloadManager.vcxproj +++ b/IcarusDownloadManager.vcxproj @@ -39,11 +39,13 @@ Application true v143 + NotSet Application false v143 + NotSet diff --git a/IcarusDownloadManager.vcxproj.filters b/IcarusDownloadManager.vcxproj.filters new file mode 100644 index 0000000..e61501d --- /dev/null +++ b/IcarusDownloadManager.vcxproj.filters @@ -0,0 +1,120 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/IcarusDownloadManager.vcxproj.user b/IcarusDownloadManager.vcxproj.user new file mode 100644 index 0000000..43952bb --- /dev/null +++ b/IcarusDownloadManager.vcxproj.user @@ -0,0 +1,11 @@ + + + + upload-meta -u kverse -p demolaugh -h http://localhost:5002 -smca "D:\OneDrive\media\music\mp3\bb_king\paying_the_cost_to_be_the_boss" + WindowsLocalDebugger + + + upload-meta -u kverse -p demolaugh -h http://localhost:5002 -smca "D:\OneDrive\media\music\mp3\bb_king\paying_the_cost_to_be_the_boss" + WindowsLocalDebugger + + \ No newline at end of file diff --git a/include/Managers/CommitManager.h b/include/Managers/CommitManager.h index 2506637..d3827f2 100644 --- a/include/Managers/CommitManager.h +++ b/include/Managers/CommitManager.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -92,6 +93,8 @@ private: // If 1 go with first standard, if 2 go with the second, if 0 then will default to 1 for disc and track auto mode = 0; const Str &songPath = song.songPath; + auto file = std::filesystem::path(songPath); + auto filename = file.filename().string();; auto trd = song.songPath.find("trackd"); auto tr = song.songPath.find("track"); @@ -107,15 +110,16 @@ private: } auto dl = [](char c, char t){ return c == t; }; - auto d = Utilities::Checks::itemIterInContainer(songPath, 'd', dl); - auto k = Utilities::Checks::itemIterInContainer(songPath, 'k', dl); - auto dot = Utilities::Checks::itemIterInContainer(songPath, '.', dl); + auto d = Utilities::Checks::itemIterInContainer(filename, 'd', dl); + auto k = Utilities::Checks::itemIterInContainer(filename, 'k', dl); + auto dot = Utilities::Checks::itemIterInContainer(filename, '.', dl); switch(mode) { case 1: { - if (k != songPath.end() && dot != songPath.end()) + // if (k != songPath.end() && dot != songPath.end()) + if (k != filename.end() && dot != filename.end()) { auto tStr = std::string(++k, dot); std::cout << "TStr: " << tStr<<"\n"; @@ -129,7 +133,8 @@ private: } case 2: { - if (k != songPath.end() && dot != songPath.end() && d != songPath.end()) + // if (k != songPath.end() && dot != songPath.end() && d != songPath.end()) + if (k != filename.end() && dot != filename.end() && d != filename.end()) { auto tStr = std::string(++k, d); auto dStr = std::string(++d, dot); diff --git a/include/Utilities/Checks.h b/include/Utilities/Checks.h index eb684ea..8743e53 100644 --- a/include/Utilities/Checks.h +++ b/include/Utilities/Checks.h @@ -44,16 +44,14 @@ namespace Utilities static auto itemIterInContainer(const Container &container, const Item &item, Func func) { auto result = false; - // std::cout< extensions; + extensions.reserve(3); + extensions.push_back(".jpg"); + extensions.push_back(".jpeg"); + extensions.push_back("."); + + return ext.compare(extensions[0]) == 0 || ext.compare(extensions[1]) == 0 || ext.compare(extensions[2]) == 0; + }; + if (extension.compare(".mp3") == 0) { Song song; @@ -354,7 +365,8 @@ void CommitManager::multiTargetUpload(const std::string &sourcePath) songs.emplace_back(std::move(song)); } - else if (extension.compare(".jpg") == 0 || extension.compare(".png") == 0) + // else if (extension.compare(".jpg") == 0 || extension.compare(".png") == 0) + else if (validImg(extension.string())) { cover.path.assign(pp.string()); } -- 2.47.3 From 10bf0fb0e137cca62db510c66912002ff46ab524 Mon Sep 17 00:00:00 2001 From: Kun Deng Date: Sun, 28 Aug 2022 10:49:28 -0400 Subject: [PATCH 2/3] Clean up and version change --- .gitignore | 3 ++ IcarusDownloadManager.rc | 99 ++++++++++++++++++++++++++++++++++++++ include/Utilities/Checks.h | 4 +- resource.h | 14 ++++++ src/Main.cpp | 2 +- src/Parsers/APIParser.cpp | 2 +- 6 files changed, 119 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 IcarusDownloadManager.rc create mode 100644 resource.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..59f00ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.vs/* +/build +/x64 diff --git a/IcarusDownloadManager.rc b/IcarusDownloadManager.rc new file mode 100644 index 0000000..78870b7 --- /dev/null +++ b/IcarusDownloadManager.rc @@ -0,0 +1,99 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,3,2,0 + PRODUCTVERSION 0,3,2,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "Tool to interact with Icarus API" + VALUE "FileVersion", "0.3.2.0" + VALUE "InternalName", "IcarusDo.exe" + VALUE "LegalCopyright", "Copyright (C) 2022" + VALUE "OriginalFilename", "IcarusDo.exe" + VALUE "ProductName", "IcarusDownloadManager" + VALUE "ProductVersion", "0.3.2.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/include/Utilities/Checks.h b/include/Utilities/Checks.h index eb684ea..8743e53 100644 --- a/include/Utilities/Checks.h +++ b/include/Utilities/Checks.h @@ -44,16 +44,14 @@ namespace Utilities static auto itemIterInContainer(const Container &container, const Item &item, Func func) { auto result = false; - // std::cout< Date: Sun, 28 Aug 2022 10:53:00 -0400 Subject: [PATCH 3/3] Updates Updated CMakeLists file, removed conan file, and have all windows configs targeting C++20 --- CMakeLists.txt | 2 +- IcarusDownloadManager.vcxproj | 6 ++++++ conanfile.txt | 20 -------------------- 3 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 conanfile.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c009a5b..1391d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endif() set(SOFTWARE_DESCRIPTION "A tool to interact with the Icarus Music streaming API") set(SOFTWARE_VERSION - "0.3.0") + "0.3.2") project(IcarusDownloadManager VERSION ${SOFTWARE_VERSION} DESCRIPTION ${SOFTWARE_DESCRIPTION} LANGUAGES CXX) diff --git a/IcarusDownloadManager.vcxproj b/IcarusDownloadManager.vcxproj index 7fa6cf8..fc86cd6 100644 --- a/IcarusDownloadManager.vcxproj +++ b/IcarusDownloadManager.vcxproj @@ -82,6 +82,7 @@ Level3 ProgramDatabase Disabled + stdcpp20 MachineX86 @@ -95,6 +96,7 @@ MultiThreadedDLL Level3 ProgramDatabase + stdcpp20 MachineX86 @@ -150,6 +152,10 @@ + + + + diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index cf5429e..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,20 +0,0 @@ -[requires] -nlohmann_json/3.10.4 -openssl/1.1.1l -libcurl/7.80.0 -cpr/1.7.2 - -[generators] -cmake - -[options] -openssl:shared=False -libcurl:shared=False -cpr:shared=False -libcurl:with_ssl=openssl -libcurl:with_ftp=False -libcurl:with_gopher=False -libcurl:with_imap=False -libcurl:with_pop3=False -libcurl:with_smb=False -libcurl:with_smtp=False \ No newline at end of file -- 2.47.3