Standardize all SquidWTF API URL formats to prevent double slashes

This commit is contained in:
2026-01-30 12:38:19 -05:00
parent 6713007650
commit a06bf42887
3 changed files with 12 additions and 12 deletions

View File

@@ -208,7 +208,7 @@ public class SquidWTFDownloadService : BaseDownloadService
_ => "LOSSLESS" // Default to lossless
};
var url = $"{_currentApiBase}track/?id={trackId}&quality={quality}";
var url = $"{_currentApiBase}/track?id={trackId}&quality={quality}";
Console.WriteLine($"%%%%%%%%%%%%%%%%%%% URL For downloads??: {url}");

View File

@@ -95,7 +95,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
{
try
{
var url = $"{_currentApiBase}/search/?s={Uri.EscapeDataString(query)}";
var url = $"{_currentApiBase}/search?s={Uri.EscapeDataString(query)}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode)
@@ -133,7 +133,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
{
try
{
var url = $"{_currentApiBase}/search/?al={Uri.EscapeDataString(query)}";
var url = $"{_currentApiBase}/search?al={Uri.EscapeDataString(query)}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode)
@@ -172,7 +172,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
{
try
{
var url = $"{_currentApiBase}/search/?a={Uri.EscapeDataString(query)}";
var url = $"{_currentApiBase}/search?a={Uri.EscapeDataString(query)}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode)
@@ -211,7 +211,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
{
try
{
var url = $"{_currentApiBase}/search/?p={Uri.EscapeDataString(query)}";
var url = $"{_currentApiBase}/search?p={Uri.EscapeDataString(query)}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode) return new List<ExternalPlaylist>();
@@ -264,7 +264,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
try
{
// Use the /info endpoint for full track metadata
var url = $"{_currentApiBase}/info/?id={externalId}";
var url = $"{_currentApiBase}/info?id={externalId}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode) return null;
@@ -296,7 +296,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
try
{
// Use the /info endpoint for full track metadata
var url = $"{_currentApiBase}/album/?id={externalId}";
var url = $"{_currentApiBase}/album?id={externalId}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode) return null;
@@ -356,7 +356,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
try
{
// Use the /info endpoint for full track metadata
var url = $"{_currentApiBase}/artist/?f={externalId}";
var url = $"{_currentApiBase}/artist?f={externalId}";
_logger.LogInformation("Fetching artist from {Url}", url);
var response = await _httpClient.GetAsync(url);
@@ -435,7 +435,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
_logger.LogInformation("GetArtistAlbumsAsync called for SquidWTF artist {ExternalId}", externalId);
var url = $"{_currentApiBase}/artist/?f={externalId}";
var url = $"{_currentApiBase}/artist?f={externalId}";
_logger.LogInformation("Fetching artist albums from URL: {Url}", url);
var response = await _httpClient.GetAsync(url);
@@ -483,7 +483,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
try
{
var url = $"{_currentApiBase}/playlist/?id={externalId}";
var url = $"{_currentApiBase}/playlist?id={externalId}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode) return null;
@@ -507,7 +507,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
try
{
var url = $"{_currentApiBase}/playlist/?id={externalId}";
var url = $"{_currentApiBase}/playlist?id={externalId}";
var response = await _httpClient.GetAsync(url);
if (!response.IsSuccessStatusCode) return new List<Song>();

View File

@@ -95,7 +95,7 @@ public class SquidWTFStartupValidator : BaseStartupValidator
try
{
// Test search with a simple query
var searchUrl = $"{_apiBase}search/?s=Taylor%20Swift";
var searchUrl = $"{_apiBase}/search?s=Taylor%20Swift";
var searchResponse = await _httpClient.GetAsync(searchUrl, cancellationToken);
if (searchResponse.IsSuccessStatusCode)