API Connection Cleanup & Bugfixes

This commit is contained in:
daniel-c-harvey
2025-09-08 11:10:23 -04:00
parent c6f4ffc1fe
commit bf054f3d1b
10 changed files with 44 additions and 18 deletions
@@ -4,7 +4,6 @@ using NetBlocks.Models;
using System.Text.Json;
using System.Web;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace DeepDrftWeb.Client.Clients;
@@ -25,7 +25,7 @@ public class TrackMediaClient
public async Task<TrackMediaResponse> GetTrackMedia(string trackId)
{
var response = await _http.GetAsync($"track/{trackId}");
var response = await _http.GetAsync($"api/track/{trackId}");
response.EnsureSuccessStatusCode();
var contentLength = response.Content.Headers.ContentLength ?? 0;
+9 -2
View File
@@ -51,8 +51,15 @@ public partial class TracksView : ComponentBase
private async Task PlayTrack(TrackEntity? track)
{
if (track == null && _selectedTrack == null || track?.Id == _selectedTrack?.Id) return;
await AudioPlaybackEngine.LoadTrack(track);
if (track is null)
{
await AudioPlaybackEngine.Stop();
}
else
{
await AudioPlaybackEngine.LoadTrack(track);
}
StateHasChanged();
}
}
@@ -6,6 +6,6 @@
}
},
"ApiUrls": {
"ContentApi": "http://localhost:54493/api/"
"ContentApi": "http://localhost:54494/"
}
}
+1 -1
View File
@@ -6,6 +6,6 @@
}
},
"ApiUrls": {
"ContentApi": "https://media.deepdrft.com/api/"
"ContentApi": "https://media.deepdrft.com/"
}
}