LaunchBoxContributors
On this page

IGameDataManager14.1

Interface in Unbroken.LaunchBox.Plugins.Services.GameData

C#
public interface IGameDataManager
Browses catalogs and queries descriptive metadata, media candidates, and community completion estimates from installed game-data sources.

Remarks

Request this service by declaring a public constructor with an IGameDataManager parameter and call asynchronously after activation. Each capability is independently optional. Queries return provider observations without applying library changes, downloading assets, or initiating sign-in. The host serializes managed provider calls with its existing game-data runtime. Caller cancellation throws OperationCanceledException; retrieval problems are reported in results. Ordinary warning diagnostics preserve Success when retrieval completed; warnings remain available in the result's diagnostics and Message.

A provider's PluginAccountNotConfiguredException produces Unconfigured. Missing accounts do not change capability support flags. Retrieval stops without offering sign-in; earlier batches can remain as incomplete observations. Authentication rejection and uncertain account state remain failures. No separate achievement or connection preflight is required.

Methods

  • GetCatalogPageAsyncBrowses one bounded page of the source's game catalog.
  • GetCompletionTimesAsyncQueries community completion-time estimates for one source-local game, independently of metadata, media, or personal playtime.
  • GetMediaAsyncQueries media candidates for known source-local game IDs.
  • GetMetadataAsyncQueries descriptive metadata for known source-local game IDs.
  • GetPlatformsAsyncLists a source's catalog platforms without requiring library ownership or achievement support.
  • GetSourcesAsyncLists registered game-data sources without invoking their retrieval capabilities.

GetCatalogPageAsync

C#
Task<PluginServiceResult<GameCatalogPage>> GetCatalogPageAsync(
    string sourceId,
    GameCatalogRequest request,
    CancellationToken cancellationToken
)
Browses one bounded page of the source's game catalog.
sourceId
The game-data source identity.
request
Optional platform filter, page size, and continuation from a complete previous page.
cancellationToken
Cancels retrieval.

Returns

Existing metadata and media payloads in a catalog page. Follow NextPageToken on a complete page; only a complete page with no continuation establishes the end. Incomplete or failed pages can retain partial data but cannot advance.

Remarks

Makes one attempt without automatic retries or persistent caching. Incomplete or Failed status alone is not an instruction to retry. When Retry is present, honor its CanRetry, RetryAfter, and CountsAsAttempt values. Any retry must use the same page request and a bounded retry policy; without Retry, callers may still choose to retry a transient failure. Continuations are opaque, temporary, and scoped to the source, account, and platform filter. Queries do not import games or download artwork.

GetCompletionTimesAsync

C#
Task<PluginServiceResult<IReadOnlyList<GameCompletionTime>>> GetCompletionTimesAsync(
    string sourceId,
    string gameId,
    CancellationToken cancellationToken
)
Queries community completion-time estimates for one source-local game, independently of metadata, media, or personal playtime.
sourceId
The game-data source identity.
gameId
The source-local game identity.
cancellationToken
Cancels retrieval.

Returns

Read-only existing completion-time payloads. An empty Success means no known estimates. Null values within estimates remain unknown; unsupported, unavailable, and failed queries have distinct outcomes.

GetMediaAsync

C#
Task<PluginServiceResult<GameMediaResult>> GetMediaAsync(
    string sourceId,
    GameMediaRequest request,
    CancellationToken cancellationToken
)
Queries media candidates for known source-local game IDs.
sourceId
The game-data source identity.
request
Existing media request containing at most 100 game IDs. Region preferences and media selection are preserved; null requests all media types, otherwise select at least one type.
cancellationToken
Cancels retrieval.

Returns

The existing media result and host outcome. Candidate URLs, variants, and composition information are preserved. A complete empty catalog means no candidates; omitted or incomplete observations remain unknown.

Remarks

Uses the same batching and retry rules as metadata. An empty game list avoids provider retrieval. Returned assets are candidates for the caller's use; this query does not run the host's import or download workflow.

GetMetadataAsync

C#
Task<PluginServiceResult<GameMetadataResult>> GetMetadataAsync(
    string sourceId,
    GameMetadataRequest request,
    CancellationToken cancellationToken
)
Queries descriptive metadata for known source-local game IDs.
sourceId
The game-data source identity.
request
Existing metadata request containing at most 100 game IDs. Duplicate IDs are queried once. The host splits the request to the provider's batch limit.
cancellationToken
Cancels retrieval.

Returns

The existing metadata result, including completeness, diagnostics, and retry information, inside the shared host outcome. Omitted games and fields remain unknown. Valid partial observations can accompany Incomplete or Failed.

Remarks

Queries make one attempt per batch and stop on a failure or rate-limit deferral. They do not automatically retry. Honor the returned Retry information before requesting another attempt. These reads have no persistent consumer cache.

GetPlatformsAsync

C#
Task<PluginServiceResult<IReadOnlyList<GameCatalogPlatform>>> GetPlatformsAsync(
    string sourceId,
    CancellationToken cancellationToken
)
Lists a source's catalog platforms without requiring library ownership or achievement support.
sourceId
The game-data source identity.
cancellationToken
Cancels retrieval.

Returns

Read-only platform identities and names. Empty Success means no platform filters; unsupported, unavailable, and failed queries remain distinct.

GetSourcesAsync

C#
Task<IReadOnlyList<GameDataSourceInfo>> GetSourcesAsync(
    CancellationToken cancellationToken
)
Lists registered game-data sources without invoking their retrieval capabilities.
cancellationToken
Cancels discovery.

Returns

One entry per registered source with its currently supported operations, including built-in sources. Disabled or conflicting sources are marked unavailable with all support properties false. Removed sources are omitted.