TrackSeries.FanArtTV.Client.OpenTelemetry 2.0.4

dotnet add package TrackSeries.FanArtTV.Client.OpenTelemetry --version 2.0.4
                    
NuGet\Install-Package TrackSeries.FanArtTV.Client.OpenTelemetry -Version 2.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrackSeries.FanArtTV.Client.OpenTelemetry" Version="2.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TrackSeries.FanArtTV.Client.OpenTelemetry" Version="2.0.4" />
                    
Directory.Packages.props
<PackageReference Include="TrackSeries.FanArtTV.Client.OpenTelemetry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TrackSeries.FanArtTV.Client.OpenTelemetry --version 2.0.4
                    
#r "nuget: TrackSeries.FanArtTV.Client.OpenTelemetry, 2.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TrackSeries.FanArtTV.Client.OpenTelemetry@2.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TrackSeries.FanArtTV.Client.OpenTelemetry&version=2.0.4
                    
Install as a Cake Addin
#tool nuget:?package=TrackSeries.FanArtTV.Client.OpenTelemetry&version=2.0.4
                    
Install as a Cake Tool

TrackSeries FanArtTV .NET Client

.NET Client for the FanArt.TV API integrated with IHttpClientFactory best practices and IServiceCollection.

Build NuGet

Getting Started

The best way of using the client is adding the dependencies to the ServiceCollection and resolving IFanArtTVClient where you'd like to use it:

services.AddFanArtTVClient(options => 
{
    options.ApiKey = "Set here your API-KEY for FanArtTV";
});

The client targets the FanArtTV v3.2 API and uses IHttpClientFactory. By default it installs the standard .NET HTTP resilience pipeline, including retries with jitter and Retry-After support, timeouts, rate limiting, and a circuit breaker.

Options can also be loaded from configuration:

{
  "FanArtTV": {
    "ApiKey": "Set here your API-KEY for FanArtTV",
    "ClientKey": "Optional personal key",
    "BaseAddress": "https://webservice.fanart.tv/v3.2/"
  }
}
services.AddFanArtTVClientFromConfiguration(configuration.GetSection("FanArtTV"));

HTTP handlers and resilience

AddFanArtTVClient returns the standard IHttpClientBuilder, so application handlers can be appended normally:

services.AddTransient<MyHandler>();

services
    .AddFanArtTVClient(options => options.ApiKey = "api-key")
    .AddHttpMessageHandler<MyHandler>();

Handlers appended this way execute inside the default resilience pipeline and therefore run once per attempt. To own the complete handler and resilience pipeline, disable the library default and add exactly one application pipeline:

services
    .AddFanArtTVClient(
        FanArtTVResilienceMode.None,
        options => options.ApiKey = "api-key")
    .AddHttpMessageHandler<MyHandler>()
    .AddStandardResilienceHandler(options =>
    {
        options.Retry.MaxRetryAttempts = 2;
    });

Use FanArtTVResilienceMode.None when resilience is configured globally or when adding a custom AddResilienceHandler or AddStandardResilienceHandler; stacking resilience handlers multiplies attempts and delays.

OpenTelemetry

Install the optional integration package to collect the client's traces and metrics without manually registering its instrumentation names:

dotnet add package TrackSeries.FanArtTV.Client.OpenTelemetry
services
    .AddOpenTelemetry()
    .AddFanArtTVClientInstrumentation();

Configure exporters, resources and sampling in the application as usual. The standard HttpClient instrumentation can be enabled alongside this integration to observe individual HTTP attempts, while the FanArtTV activity represents the logical request across retries.

Services that only need the stable source and meter names can reference the lightweight TrackSeries.FanArtTV.Client.Diagnostics package without pulling in the client or OpenTelemetry dependencies.

Integration example

Migrating to version 2

Version 2 moves the default API from v3 to v3.2, enables nullable reference types, and returns nullable results when the FanArtTV API can return an empty response. Music albums are now exposed as List<AlbumImages> and each item identifies itself through ReleaseGroupId, matching the v3.2 response shape. Image models also expose v3.2 dimensions, timestamps, and collection counts.

The concrete client and options types are now sealed; depend on IFanArtTVClient, ITVClient, IMoviesClient, and IMusicClient when substituting implementations.

Configuration is validated when IFanArtTVClient is resolved. An API key is required, the base address must use HTTPS, and custom base paths are normalized with a trailing slash.

Configuration binding is explicit in version 2: pass the desired IConfigurationSection to AddFanArtTVClientFromConfiguration. Registration through an options delegate no longer requires an IConfiguration service.

Non-success API responses are surfaced as HttpRequestException. Applications should avoid bulk requests and unnecessary polling in accordance with FanArtTV's API-key rules.

References

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.4 1,394 8/7/2026
2.0.3 116 8/7/2026