From 8b4fa2a3b6b1a3d75fd4ae5a61266e159d22e095 Mon Sep 17 00:00:00 2001 From: ComradeCrow Date: Wed, 17 May 2023 16:05:13 -0700 Subject: Changes Start Documenting, add more cpack stuff --- src/YtdlpWrapper.hpp | 20 ---------------- src/invapi.hpp | 27 ---------------------- src/main.cpp | 12 +++++----- src/sqliteinterface.hpp | 21 ----------------- src/tui.hpp | 23 ------------------- src/video.hpp | 61 ------------------------------------------------- 6 files changed, 6 insertions(+), 158 deletions(-) delete mode 100644 src/YtdlpWrapper.hpp delete mode 100644 src/invapi.hpp delete mode 100644 src/sqliteinterface.hpp delete mode 100644 src/tui.hpp delete mode 100644 src/video.hpp (limited to 'src') diff --git a/src/YtdlpWrapper.hpp b/src/YtdlpWrapper.hpp deleted file mode 100644 index 9ee2410..0000000 --- a/src/YtdlpWrapper.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef YTDLPWRAPPER_H -#define YTDLPWRAPPER_H -#include -#include -#include -#include -#include - -class YtdlpWrapper { - - public: - nlohmann::json getJsonSearch(const std::string& searchTerm, int limit = 1); - Video::video getVideoByUrl(const std::string& url); - std::vector searchVideos(const std::string& searchterm, int limit = 1); - private: - pybind11::object get_ytdl(); -}; - - -#endif \ No newline at end of file diff --git a/src/invapi.hpp b/src/invapi.hpp deleted file mode 100644 index 3fb4c05..0000000 --- a/src/invapi.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef INVAPI_H -#define INVAPI_H -#include -#include -#include - -#include "sqliteinterface.hpp" - -class InvidiousApi { - - public: - - InvidiousApi(const std::string& url); - static std::vector getInstances(); - static void saveInstancesToDb(SqliteInterface& sqldb); - std::string getInstance(); - void setInstance(const std::string& newUrl); - - void test(); - private: - - std::string instanceUrl; - cpr::Session session; -}; - - -#endif \ No newline at end of file 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 #endif -#include "tui.hpp" -#include "video.hpp" -#include "invapi.hpp" -#include "YtdlpWrapper.hpp" -#include "sqliteinterface.hpp" +#include +#include +#include +#include +#include // 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 diff --git a/src/sqliteinterface.hpp b/src/sqliteinterface.hpp deleted file mode 100644 index cc4adb4..0000000 --- a/src/sqliteinterface.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef SQLITEINTERFACE_H -#define SQLITEINTERFACE_H -#include -#include -#include "video.hpp" - -class SqliteInterface { - - public: - SqliteInterface(); - ~SqliteInterface(); - void openDB(); - void closeDB(); - void createTables(); - void saveVideo(const Video::video&); - void saveInstance(const std::string& uri, float health, const std::string& location); - private: - sqlite3* db; -}; - -#endif \ No newline at end of file diff --git a/src/tui.hpp b/src/tui.hpp deleted file mode 100644 index 112135c..0000000 --- a/src/tui.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TUI_H -#define TUI_H -#include -#include "ftxui/component/captured_mouse.hpp" // for ftxui -#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical -#include "ftxui/component/component_base.hpp" // for ComponentBase -#include "ftxui/component/component_options.hpp" // for InputOption -#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive -#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border -#include "ftxui/util/ref.hpp" // for Ref - -class Tui { - public: - bool renderSearchBar(std::string&, int&); - bool isCancelled(); - private: - ftxui::Closure cancelAndExit(ftxui::ScreenInteractive&); - bool cancel{false}; - -}; - - -#endif \ No newline at end of file diff --git a/src/video.hpp b/src/video.hpp deleted file mode 100644 index fd57d0b..0000000 --- a/src/video.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef VIDEO_H -#define VIDEO_H -#include -#include -#include -#include - -namespace Video { - - struct format { - - std::string format; - std::string url; - std::string vcodec; - std::string acodec; - std::string ext; - std::optional quality; - std::optional resolution; - std::optional height; - std::optional width; - }; - - struct thumbnail { - - std::string url; - int preference; - std::string id; - std::optional resolution; - std::optional height; - std::optional width; - }; - - struct video { - - std::string id; - std::string title; - std::string url; - std::string channelId; - std::string channelUrl; - std::vector formats; - std::vector thumbnails; - std::optional uploader; - std::optional uploaderId; - std::optional uploaderUrl; - std::optional duration; - std::optional viewcount; - std::optional description; - }; - - void to_json(nlohmann::json& j, const format& f); - void to_json(nlohmann::json& j, const std::vector& v); - void to_json(nlohmann::json& j, const thumbnail& t); - void to_json(nlohmann::json& j, const std::vector& v); - void to_json(nlohmann::json& j, const video& v); - void from_json(const nlohmann::json& j, format& f); - void from_json(const nlohmann::json& j, std::vector& v); - void from_json(const nlohmann::json& j, thumbnail& t); - void from_json(const nlohmann::json& j, std::vector& v); - void from_json(const nlohmann::json& j, video& v); -}; -#endif \ No newline at end of file -- cgit 1.4.1-2-gfad0