Skip to content

WikimediaCatalogProvider

ClassAssetInventoryAssetInventory.Editor
public sealed class WikimediaCatalogProvider : RemoteCatalogProviderBase, IRemoteCatalogProvider, IRemoteCatalogAccessProbe

Searches Wikimedia Commons media files and exposes their original HTTPS downloads with attribution and license metadata.

public WikimediaCatalogProvider(HttpClient client = null)

Creates a Wikimedia provider with a caller-owned HTTP client, or an owned default client when none is supplied.

Parameters

Name Type
client System.Net.Http.HttpClient

FetchAsync(RemoteCatalogRequest, CancellationToken)

Section titled “FetchAsync(RemoteCatalogRequest, CancellationToken)”
public override Task<RemoteCatalogPage> FetchAsync(RemoteCatalogRequest request, CancellationToken cancellationToken)

Searches the Commons file namespace with offset pagination and maps file, attribution, category, and license metadata into catalog items.

Parameters

Name Type
request AssetInventory.RemoteCatalogRequest
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{AssetInventory.RemoteCatalogPage}

GetVariantsAsync(string, RemoteCatalogRequest, CancellationToken)

Section titled “GetVariantsAsync(string, RemoteCatalogRequest, CancellationToken)”
public override Task<IReadOnlyList<RemoteDownloadVariant>> GetVariantsAsync(string itemId, RemoteCatalogRequest request, CancellationToken cancellationToken)

Looks up a Commons page identifier and returns its original HTTPS file when the file URL and extension can be resolved.

Parameters

Name Type
itemId System.String
request AssetInventory.RemoteCatalogRequest
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{System.Collections.Generic.IReadOnlyList{AssetInventory.RemoteDownloadVariant}}

public override string Id { get; }

Returns

System.String