mixed refactor
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.SRFPlay.Api.Models;
|
||||
using Jellyfin.Plugin.SRFPlay.Api.Models.PlayV3;
|
||||
using Jellyfin.Plugin.SRFPlay.Configuration;
|
||||
using Jellyfin.Plugin.SRFPlay.Constants;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.SRFPlay.Api;
|
||||
@@ -17,9 +18,7 @@ namespace Jellyfin.Plugin.SRFPlay.Api;
|
||||
/// </summary>
|
||||
public class SRFApiClient : IDisposable
|
||||
{
|
||||
private const string BaseUrl = "https://il.srgssr.ch/integrationlayer/2.0";
|
||||
private const string PlayV3BaseUrlTemplate = "https://www.{0}.ch/play/v3/api/{0}/production/";
|
||||
private static readonly System.Text.CompositeFormat PlayV3UrlFormat = System.Text.CompositeFormat.Parse(PlayV3BaseUrlTemplate);
|
||||
private static readonly System.Text.CompositeFormat PlayV3UrlFormat = System.Text.CompositeFormat.Parse(ApiEndpoints.PlayV3BaseUrlTemplate);
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly HttpClient _playV3HttpClient;
|
||||
private readonly ILogger _logger;
|
||||
@@ -47,7 +46,7 @@ public class SRFApiClient : IDisposable
|
||||
_logger.LogInformation("SRFApiClient initializing without proxy");
|
||||
}
|
||||
|
||||
_httpClient = CreateHttpClient(BaseUrl);
|
||||
_httpClient = CreateHttpClient(ApiEndpoints.IntegrationLayerBaseUrl);
|
||||
_playV3HttpClient = CreateHttpClient(null);
|
||||
|
||||
_jsonOptions = new JsonSerializerOptions
|
||||
@@ -137,7 +136,7 @@ public class SRFApiClient : IDisposable
|
||||
try
|
||||
{
|
||||
var url = $"/mediaComposition/byUrn/{urn}.json";
|
||||
var fullUrl = $"{BaseUrl}{url}";
|
||||
var fullUrl = $"{ApiEndpoints.IntegrationLayerBaseUrl}{url}";
|
||||
_logger.LogInformation("Fetching media composition for URN: {Urn} from {Url}", urn, fullUrl);
|
||||
|
||||
// HttpClient consistently fails with 404, use curl directly
|
||||
|
||||
Reference in New Issue
Block a user