mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
Standardize all SquidWTF API URL formats to prevent double slashes
This commit is contained in:
@@ -208,7 +208,7 @@ public class SquidWTFDownloadService : BaseDownloadService
|
|||||||
_ => "LOSSLESS" // Default to lossless
|
_ => "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}");
|
Console.WriteLine($"%%%%%%%%%%%%%%%%%%% URL For downloads??: {url}");
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/search/?s={Uri.EscapeDataString(query)}";
|
var url = $"{_currentApiBase}/search?s={Uri.EscapeDataString(query)}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
@@ -133,7 +133,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/search/?al={Uri.EscapeDataString(query)}";
|
var url = $"{_currentApiBase}/search?al={Uri.EscapeDataString(query)}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
@@ -172,7 +172,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/search/?a={Uri.EscapeDataString(query)}";
|
var url = $"{_currentApiBase}/search?a={Uri.EscapeDataString(query)}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
@@ -211,7 +211,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/search/?p={Uri.EscapeDataString(query)}";
|
var url = $"{_currentApiBase}/search?p={Uri.EscapeDataString(query)}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode) return new List<ExternalPlaylist>();
|
if (!response.IsSuccessStatusCode) return new List<ExternalPlaylist>();
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Use the /info endpoint for full track metadata
|
// 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);
|
var response = await _httpClient.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode) return null;
|
if (!response.IsSuccessStatusCode) return null;
|
||||||
@@ -296,7 +296,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Use the /info endpoint for full track metadata
|
// 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);
|
var response = await _httpClient.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode) return null;
|
if (!response.IsSuccessStatusCode) return null;
|
||||||
@@ -356,7 +356,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Use the /info endpoint for full track metadata
|
// 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);
|
_logger.LogInformation("Fetching artist from {Url}", url);
|
||||||
|
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
@@ -435,7 +435,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
|
|
||||||
_logger.LogInformation("GetArtistAlbumsAsync called for SquidWTF artist {ExternalId}", externalId);
|
_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);
|
_logger.LogInformation("Fetching artist albums from URL: {Url}", url);
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/playlist/?id={externalId}";
|
var url = $"{_currentApiBase}/playlist?id={externalId}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode) return null;
|
if (!response.IsSuccessStatusCode) return null;
|
||||||
|
|
||||||
@@ -507,7 +507,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var url = $"{_currentApiBase}/playlist/?id={externalId}";
|
var url = $"{_currentApiBase}/playlist?id={externalId}";
|
||||||
var response = await _httpClient.GetAsync(url);
|
var response = await _httpClient.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode) return new List<Song>();
|
if (!response.IsSuccessStatusCode) return new List<Song>();
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class SquidWTFStartupValidator : BaseStartupValidator
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Test search with a simple query
|
// 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);
|
var searchResponse = await _httpClient.GetAsync(searchUrl, cancellationToken);
|
||||||
|
|
||||||
if (searchResponse.IsSuccessStatusCode)
|
if (searchResponse.IsSuccessStatusCode)
|
||||||
|
|||||||
Reference in New Issue
Block a user