From f73c45bb4898c6c34a4c7ad073cb6251a4817e84 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Thu, 10 Sep 2026 03:29:30 -0500 Subject: [PATCH] Target crosslang v0.0.10, add /api/v1/progress_ex.json --- Tesses.YouTubeDownloader.Server/src/main.tcross | 16 ++++++++-------- .../src/YouTubeDownloader.tcross | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tesses.YouTubeDownloader.Server/src/main.tcross b/Tesses.YouTubeDownloader.Server/src/main.tcross index 8e940df..e842feb 100644 --- a/Tesses.YouTubeDownloader.Server/src/main.tcross +++ b/Tesses.YouTubeDownloader.Server/src/main.tcross @@ -1014,9 +1014,9 @@ class TYTDApp { } else if(ctx.Path == "/add") { - var url = ctx.QueryParams.TryGetFirst("url"); - var action =ctx.QueryParams.TryGetFirst("action"); - var res = ctx.QueryParams.TryGetFirst("res"); + var url = ctx.BodyParams.TryGetFirst("url"); + var action =ctx.BodyParams.TryGetFirst("action"); + var res = ctx.BodyParams.TryGetFirst("res"); if(action == "add") { this.TYTD.DownloadItem(url,res); @@ -1044,9 +1044,9 @@ class TYTDApp { } else if(ctx.Path == "/add-video") { - var url = ctx.QueryParams.TryGetFirst("url"); - var action =ctx.QueryParams.TryGetFirst("action"); - var res = ctx.QueryParams.TryGetFirst("res"); + var url = ctx.BodyParams.TryGetFirst("url"); + var action =ctx.BodyParams.TryGetFirst("action"); + var res = ctx.BodyParams.TryGetFirst("res"); if(action == "add") { this.TYTD.DownloadItem(url,res); @@ -1067,10 +1067,10 @@ class TYTDApp { } else if(ctx.Path == "/add-to-list") { - var id = ctx.QueryParams.TryGetFirst("id"); + var id = ctx.BodyParams.TryGetFirst("id"); if(TypeOf(id) != "String") id = ""; - var name = ctx.QueryParams.TryGetFirst("name"); + var name = ctx.BodyParams.TryGetFirst("name"); if(TypeOf(name) != "String") name = ""; if(name == "") diff --git a/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross b/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross index 91f90a6..0f82c68 100644 --- a/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross +++ b/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross @@ -883,9 +883,9 @@ class TYTD.Downloader { const resultQueue = Sqlite.Exec(db, "SELECT COUNT(*) FROM queue;"); Sqlite.Close(db); - const videoCount = TypeIsList(resultVideos) ? (ParseLong(resultVideos.["COUNT(*)"])??0) : 0; + const videoCount = TypeIsList(resultVideos) ? (ParseLong(resultVideos[0].["COUNT(*)"])??0) : 0; - const queueCount = TypeIsList(resultQueue) ? (ParseLong(resultQueue.["COUNT(*)"])??0) : 0; + const queueCount = TypeIsList(resultQueue) ? (ParseLong(resultQueue[0].["COUNT(*)"])??0) : 0; const progress = {CurrentVideoProgress,CurrentVideo,QueueCount=queueCount, VideoCount=videoCount};