diff --git a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj index 26157c9ae..ef0a52a95 100644 --- a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj +++ b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/ErsatzTV.Core/ErsatzTV.Core.csproj b/ErsatzTV.Core/ErsatzTV.Core.csproj index d753c77f6..d57583fd0 100644 --- a/ErsatzTV.Core/ErsatzTV.Core.csproj +++ b/ErsatzTV.Core/ErsatzTV.Core.csproj @@ -21,12 +21,12 @@ - + - - + + diff --git a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj index 22d393f1f..99b834cd6 100644 --- a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj +++ b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj index 23fe09aea..0cc3e304a 100644 --- a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj +++ b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj @@ -17,7 +17,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj index 6927a6a5c..1db3b24a2 100644 --- a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj +++ b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.Infrastructure/Emby/EmbyApiClient.cs b/ErsatzTV.Infrastructure/Emby/EmbyApiClient.cs index 9b955302d..b375980e6 100644 --- a/ErsatzTV.Infrastructure/Emby/EmbyApiClient.cs +++ b/ErsatzTV.Infrastructure/Emby/EmbyApiClient.cs @@ -33,7 +33,7 @@ public class EmbyApiClient : IEmbyApiClient { try { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); var cts = new CancellationTokenSource(); cts.CancelAfter(TimeSpan.FromSeconds(5)); return await service.GetSystemInformation(apiKey, cts.Token) @@ -55,7 +55,7 @@ public class EmbyApiClient : IEmbyApiClient { try { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); List libraries = await service.GetLibraries(apiKey); return libraries .Map(Project) @@ -177,7 +177,7 @@ public class EmbyApiClient : IEmbyApiClient { try { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); EmbyPlaybackInfoResponse playbackInfo = await service.GetPlaybackInfo(apiKey, itemId); Option maybeVersion = ProjectToMediaVersion(playbackInfo); return maybeVersion.ToEither(() => BaseError.New("Unable to locate Emby statistics")); @@ -197,7 +197,7 @@ public class EmbyApiClient : IEmbyApiClient { try { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); EmbyLibraryItemsResponse itemsResponse = await service.GetShowLibraryItems( apiKey, library.ItemId, @@ -228,7 +228,7 @@ public class EmbyApiClient : IEmbyApiClient { try { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); EmbySearchHintsResponse searchResponse = await service.SearchHints( apiKey, showTitle, @@ -276,7 +276,7 @@ public class EmbyApiClient : IEmbyApiClient Func> getItems, Func, EmbyLibraryItemResponse, Option> mapper) { - IEmbyApi service = RestService.For(address); + IEmbyApi service = RestService.ForGenerated(address); const int PAGE_SIZE = 10; int pages = int.MaxValue; diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index 1b8535a5c..e85101a73 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -16,10 +16,10 @@ - + - - + + @@ -30,13 +30,13 @@ - - - + + + - + diff --git a/ErsatzTV.Infrastructure/GitHub/GitHubApiClient.cs b/ErsatzTV.Infrastructure/GitHub/GitHubApiClient.cs index a01beca65..4d5fcc6a8 100644 --- a/ErsatzTV.Infrastructure/GitHub/GitHubApiClient.cs +++ b/ErsatzTV.Infrastructure/GitHub/GitHubApiClient.cs @@ -10,7 +10,7 @@ public class GitHubApiClient : IGitHubApiClient { try { - IGitHubApi service = RestService.For("https://api.github.com"); + IGitHubApi service = RestService.ForGenerated("https://api.github.com"); return await service.GetReleases(cancellationToken).Map(releases => releases.Head().Body); } catch (Exception ex) @@ -23,7 +23,7 @@ public class GitHubApiClient : IGitHubApiClient { try { - IGitHubApi service = RestService.For("https://api.github.com"); + IGitHubApi service = RestService.ForGenerated("https://api.github.com"); return await service.GetTag(tag, cancellationToken).Map(t => t.Body); } catch (Exception ex) diff --git a/ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs b/ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs index a1a8a6118..b4ee37f8b 100644 --- a/ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs +++ b/ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs @@ -1124,6 +1124,6 @@ public class JellyfinApiClient : IJellyfinApiClient { var client = _httpClientFactory.CreateClient("RefitCustomClient"); client.BaseAddress = new Uri(address); - return RestService.For(client); + return RestService.ForGenerated(client); } } diff --git a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs index fe570fb17..297acc9ca 100644 --- a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs +++ b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs @@ -42,7 +42,7 @@ public class PlexServerApiClient(PlexEtag plexEtag, ILogger { try { - IPlexServerApi service = RestService.For( + IPlexServerApi service = RestService.ForGenerated( new HttpClient { BaseAddress = new Uri(connection.Uri), @@ -416,7 +416,7 @@ public class PlexServerApiClient(PlexEtag plexEtag, ILogger { try { - IPlexServerApi service = RestService.For( + IPlexServerApi service = RestService.ForGenerated( new HttpClient { BaseAddress = new Uri(connection.Uri) }); PlexMediaContainerResponse> searchResponse = @@ -466,7 +466,7 @@ public class PlexServerApiClient(PlexEtag plexEtag, ILogger const int PAGE_SIZE = 10; - IPlexServerApi jsonService = RestService.For(connection.Uri); + IPlexServerApi jsonService = RestService.ForGenerated(connection.Uri); int pages = (size - 1) / PAGE_SIZE + 1; for (var i = 0; i < pages; i++) @@ -490,7 +490,7 @@ public class PlexServerApiClient(PlexEtag plexEtag, ILogger TimeSpan httpClientTimeout = timeout ?? TimeSpan.FromSeconds(30); - return RestService.For( + return RestService.ForGenerated( new HttpClient { BaseAddress = new Uri(uri), diff --git a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj index 99151fb03..61afd1f89 100644 --- a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj +++ b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index ddd410f5c..f9ab166ed 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -37,7 +37,7 @@ - + @@ -56,9 +56,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/ErsatzTV/Startup.cs b/ErsatzTV/Startup.cs index 0646d4616..b7a2b91ae 100644 --- a/ErsatzTV/Startup.cs +++ b/ErsatzTV/Startup.cs @@ -471,10 +471,10 @@ public class Startup services.AddMediatR(config => config.RegisterServicesFromAssemblyContaining()); - services.AddRefitClient() + services.AddRefitGeneratedClient() .ConfigureHttpClient(c => c.BaseAddress = new Uri("https://plex.tv/api/v2")); - services.AddRefitClient( + services.AddRefitGeneratedClient( new RefitSettings { ContentSerializer = new NewtonsoftJsonContentSerializer(