Add some api docs

This commit is contained in:
2025-11-20 19:29:38 -06:00
parent 9da78e364c
commit abe5ce7fba

View File

@@ -428,13 +428,11 @@ class TYTD.Downloader {
var id = TYTD.GetVideoId(vid);
if(id == null) return null;
Console.WriteLine(id);
this.Muxex.Lock();
var db = this.OpenDB();
var res = Sqlite.Exec(db, $"SELECT * FROM videos WHERE videoId = {Sqlite.Escape(id)};");
var out = null;
Console.WriteLine(res);
if(TypeOf(res) == "List" && res.Length == 1) out = res[0];
@@ -1224,7 +1222,7 @@ class TYTD.Downloader {
var d = $"INSERT INTO videos (videoId,title,lengthSeconds,keywords,channelId,shortDescription,viewCount,author,addDate,tytdTag) VALUES ({Sqlite.Escape(info.videoId)},{Sqlite.Escape(info.title)},{info.lengthSeconds},{keywordsStr},{Sqlite.Escape(info.channelId)},{Sqlite.Escape(info.shortDescription)},{info.viewCount},{Sqlite.Escape(info.author)},{DateTime.NowEpoch},{Sqlite.Escape(this.TYTDTag)});";
Console.WriteLine(Sqlite.Exec(db, d));
Sqlite.Exec(db, d);
Sqlite.Exec(db, $"INSERT INTO channels (channelId,title) VALUES ({Sqlite.Escape(info.channelId)},{Sqlite.Escape(info.author)});");
Sqlite.Close(db);
this.Mutex.Unlock();