about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cmake/FindYtdlp.cmake4
-rw-r--r--src/main.cpp2
-rw-r--r--src/sqliteinterface.cpp14
-rw-r--r--src/sqliteinterface.hpp4
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;
 };