From 2e4f644c1765c76dcc290488003a26633b51ece3 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Tue, 5 Aug 2025 11:38:55 -0500 Subject: [PATCH] Attempt to fix errors Attempt to fix errors, introduced new errors. --- FreeTubeSync/EndPoints/PingEndpoint.cs | 2 +- FreeTubeSync/EndPoints/PlaylistEndpoint.cs | 4 ---- FreeTubeSync/EndPoints/ProfileEndpoint.cs | 7 ++----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/FreeTubeSync/EndPoints/PingEndpoint.cs b/FreeTubeSync/EndPoints/PingEndpoint.cs index bda93ec..4801636 100644 --- a/FreeTubeSync/EndPoints/PingEndpoint.cs +++ b/FreeTubeSync/EndPoints/PingEndpoint.cs @@ -11,7 +11,7 @@ public static class PingEndpoint group.MapGet("/", async (CancellationToken token) => { await Task.Delay(10); - var dict = new { AppVersion = "0.1.3" }; + var dict = new { AppVersion = "0.1.4" }; return Results.Ok(dict); }); diff --git a/FreeTubeSync/EndPoints/PlaylistEndpoint.cs b/FreeTubeSync/EndPoints/PlaylistEndpoint.cs index 4b6c749..6414805 100644 --- a/FreeTubeSync/EndPoints/PlaylistEndpoint.cs +++ b/FreeTubeSync/EndPoints/PlaylistEndpoint.cs @@ -32,8 +32,6 @@ public static class PlaylistEndpoint { var vid = new Video(); vid.MapFrom(video); - await vidRepo.AddAsync(vid, ct, false); - results.videos.Add(vid); } await repository.AddAsync(results, ct); @@ -51,7 +49,6 @@ public static class PlaylistEndpoint else { video.MapFrom(f); - await vidRepo.UpdateAsync(video, ct, false); } } @@ -64,7 +61,6 @@ public static class PlaylistEndpoint { var vres = new Video(); vres.MapFrom(newVid); - await vidRepo.AddAsync(vres, ct, false); results.videos.Add(vres); } diff --git a/FreeTubeSync/EndPoints/ProfileEndpoint.cs b/FreeTubeSync/EndPoints/ProfileEndpoint.cs index 64ff164..44e3e69 100644 --- a/FreeTubeSync/EndPoints/ProfileEndpoint.cs +++ b/FreeTubeSync/EndPoints/ProfileEndpoint.cs @@ -27,12 +27,12 @@ public static class ProfileEndpoint { res = new Profile(); res.MapFrom(profileJson); + await repository.AddAsync(res, ct); + foreach (var subscription in profileJson.subscriptions) { var sub = new Subscription(); sub.MapFrom(subscription); - await subRepo.AddAsync(sub, ct, false); - res.subscriptions.Add(sub); } await repository.AddAsync(res, ct); @@ -49,7 +49,6 @@ public static class ProfileEndpoint else { subscription.MapFrom(f); - await subRepo.UpdateAsync(subscription, ct, false); } } @@ -62,8 +61,6 @@ public static class ProfileEndpoint { var sres = new Subscription(); sres.MapFrom(newSub); - await subRepo.AddAsync(sres, ct, false); - res.subscriptions.Add(sres); }