API Connection Cleanup & Bugfixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
}
|
||||
},
|
||||
"ApiUrls": {
|
||||
"ContentApi": "https://media.deepdrft.com/api/"
|
||||
"ContentApi": "https://media.deepdrft.com/"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user