diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2023-05-09 19:03:53 -0700 |
---|---|---|
committer | ComradeCrow <comradecrow@vivaldi.net> | 2023-05-09 19:03:53 -0700 |
commit | 0bde4573e5301f682d438856c4622209549718c9 (patch) | |
tree | 8b293d0ae2721f585e817240b819392cda480ddf | |
parent | 0638f3cc60d5e76b3f562aa54258bbc8641af141 (diff) | |
download | ytcpp-0bde4573e5301f682d438856c4622209549718c9.tar.gz |
slight update
try to get cmake to recognise python again
-rw-r--r-- | cmake/FindYtdlp.cmake | 4 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/sqliteinterface.cpp | 14 | ||||
-rw-r--r-- | src/sqliteinterface.hpp | 4 |
4 files changed, 13 insertions, 11 deletions
diff --git a/cmake/FindYtdlp.cmake b/cmake/FindYtdlp.cmake index a1d779d..85c3bf5 100644 --- a/cmake/FindYtdlp.cmake +++ b/cmake/FindYtdlp.cmake @@ -2,7 +2,9 @@ # # SPDX-License-Identifier: BSD-2-Clause -find_package(Python3 REQUIRED COMPONENTS Interpreter) +find_package(Python3 + REQUIRED + COMPONENTS Interpreter) execute_process(COMMAND ${Python3_EXECUTABLE} -c "import yt_dlp" RESULT_VARIABLE YTDLP_CHECK_RESULT) diff --git a/src/main.cpp b/src/main.cpp index ec86677..2f75391 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -133,6 +133,6 @@ void parseSysArgs(int argc, char **argv) { int main(int argc, char **argv) { parseSysArgs(argc, argv); - + SqliteInterface sqldb; } \ No newline at end of file diff --git a/src/sqliteinterface.cpp b/src/sqliteinterface.cpp index ec1a978..39bdb3b 100644 --- a/src/sqliteinterface.cpp +++ b/src/sqliteinterface.cpp @@ -57,8 +57,7 @@ static int callback(void *NotUsed, int argc, char **argv, char **azColName) { return 0; } -void SqliteInterface::createTables() -{ +void SqliteInterface::createTables() { char *errmsg = 0; int rc = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS INSTANCES (url TEXT PRIMARY KEY, health, location);", callback, 0, &errmsg); @@ -71,19 +70,18 @@ void SqliteInterface::createTables() } -void SqliteInterface::saveVideo() { - +void SqliteInterface::saveVideo(const Video::video& vid) { + } -SqliteInterface::SqliteInterface() -{ +SqliteInterface::SqliteInterface() { openDB(); + createTables(); } -SqliteInterface::~SqliteInterface() -{ +SqliteInterface::~SqliteInterface() { closeDB(); } \ No newline at end of file diff --git a/src/sqliteinterface.hpp b/src/sqliteinterface.hpp index 617ebd3..8d7f016 100644 --- a/src/sqliteinterface.hpp +++ b/src/sqliteinterface.hpp @@ -2,6 +2,8 @@ #define SQLITEINTERFACE_H #include <string> #include <sqlite3.h> +#include "video.hpp" + class SqliteInterface { public: @@ -10,7 +12,7 @@ class SqliteInterface { void openDB(); void closeDB(); void createTables(); - void saveVideo(); + void saveVideo(const Video::video&); private: sqlite3* db; }; |