about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorComradeCrow <comradecrow@vivaldi.net>2023-05-17 16:05:13 -0700
committerComradeCrow <comradecrow@vivaldi.net>2023-05-17 16:05:13 -0700
commit8b4fa2a3b6b1a3d75fd4ae5a61266e159d22e095 (patch)
tree6bc2c757656071d39b840f6a0db27c53b33eedd5
parent8972e4b0fdc216bf4ea1c0f7e699689d6c84de6a (diff)
downloadytcpp-8b4fa2a3b6b1a3d75fd4ae5a61266e159d22e095.tar.gz
Changes
Start Documenting, add more cpack stuff
-rw-r--r--CMakeLists.txt15
-rw-r--r--LICENSE.txt (renamed from LICENSE)0
-rw-r--r--include/YtdlpWrapper.hpp (renamed from src/YtdlpWrapper.hpp)0
-rw-r--r--include/invapi.hpp (renamed from src/invapi.hpp)0
-rw-r--r--include/sqliteinterface.hpp (renamed from src/sqliteinterface.hpp)0
-rw-r--r--include/tui.hpp (renamed from src/tui.hpp)0
-rw-r--r--include/video.hpp (renamed from src/video.hpp)26
-rw-r--r--src/main.cpp12
8 files changed, 42 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e3f249..033e0b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,12 @@ project(ytcpp
     HOMEPAGE_URL https://crow.port0.org/git/comradecrow/ytcpp.git
 )
 
+if(PROJECT_IS_TOP_LEVEL)
+  include(CTest)
+  enable_testing()
+endif()
+# set(PROJECT_SOURCE_DIR "src")
+set(PROJECT_INCLUDE_DIR "include")
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
 
@@ -57,7 +63,7 @@ add_executable(${PROJECT_NAME}
     src/video.cpp
 )
 
-target_include_directories(${PROJECT_NAME} PRIVATE src)
+target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_INCLUDE_DIR})
 
 target_compile_definitions(${PROJECT_NAME} 
     PRIVATE DEF_APPDATA="${DEF_APPDATA}"
@@ -74,3 +80,10 @@ target_link_libraries(${PROJECT_NAME}
     PRIVATE SQLite::SQLite3
     PRIVATE pybind11::embed
 )
+
+# set(CPACK_PROJECT_NAME ${PROJECT_NAME})
+# set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
+set(CPACK_PACKAGE_VENDOR "ComradeCrow")
+set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
+set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
+include(CPack)
\ No newline at end of file
diff --git a/LICENSE b/LICENSE.txt
index 11c45b7..11c45b7 100644
--- a/LICENSE
+++ b/LICENSE.txt
diff --git a/src/YtdlpWrapper.hpp b/include/YtdlpWrapper.hpp
index 9ee2410..9ee2410 100644
--- a/src/YtdlpWrapper.hpp
+++ b/include/YtdlpWrapper.hpp
diff --git a/src/invapi.hpp b/include/invapi.hpp
index 3fb4c05..3fb4c05 100644
--- a/src/invapi.hpp
+++ b/include/invapi.hpp
diff --git a/src/sqliteinterface.hpp b/include/sqliteinterface.hpp
index cc4adb4..cc4adb4 100644
--- a/src/sqliteinterface.hpp
+++ b/include/sqliteinterface.hpp
diff --git a/src/tui.hpp b/include/tui.hpp
index 112135c..112135c 100644
--- a/src/tui.hpp
+++ b/include/tui.hpp
diff --git a/src/video.hpp b/include/video.hpp
index fd57d0b..456eda9 100644
--- a/src/video.hpp
+++ b/include/video.hpp
@@ -5,31 +5,49 @@
 #include <vector>
 #include <nlohmann/json.hpp>
 
+
+///
+/// \brief Video namespace.
+/// Contains the format, thumbnail, and video structs. 
+///
 namespace Video {
 
+    ///
+    /// \brief Format structure.
+    /// This saves a video format, with the necessary url and information.
+    ///
     struct format {
     
-        std::string format;
+        std::string format; /**< Name of the format provided by Youtube */
         std::string url;
         std::string vcodec;
         std::string acodec;
-        std::string ext;
-        std::optional<float> quality;
+        std::string ext; /**< File Extention */
+        std::optional<float> quality; 
         std::optional<std::string> resolution;
         std::optional<int> height;
         std::optional<int> width;
     };
 
+    ///
+    /// \brief Thumbnail structure.
+    /// This saves a video thumbnail, with the necessary url and information.
+    ///
     struct thumbnail {
 
         std::string url;
-        int preference;
+        int preference; /**< The lower the prefrence, the worse the quality */
         std::string id;
         std::optional<std::string> resolution;
         std::optional<int> height;
         std::optional<int> width;
     };
 
+    ///
+    /// \brief Video structure.
+    /// The video structure will be used to store video objects, and will be used to
+    /// save to DB, and as a common format between invidious.io and yt-dlp.
+    ///
     struct video {
 
         std::string id;
diff --git a/src/main.cpp b/src/main.cpp
index 1bac482..ea955f0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -18,11 +18,11 @@
 #include <sys/wait.h>
 #endif
 
-#include "tui.hpp"
-#include "video.hpp"
-#include "invapi.hpp"
-#include "YtdlpWrapper.hpp"
-#include "sqliteinterface.hpp"
+#include <tui.hpp>
+#include <video.hpp>
+#include <invapi.hpp>
+#include <YtdlpWrapper.hpp>
+#include <sqliteinterface.hpp>
 
 
 // namespace py = pybind11;
@@ -137,7 +137,7 @@ int main(int argc, char **argv) {
 
     // validateStructConversions();
     parseSysArgs(argc, argv);
-    // SqliteInterface sqldb;
+    SqliteInterface sqldb;
     // InvidiousApi invapi("https://httpbin.org/get");
     // invapi.test();
 }
\ No newline at end of file