Skip to content

RemoteCatalogs

ClassAssetInventoryAssetInventory.Editor
public static class RemoteCatalogs

Coordinates remote-source settings, catalog synchronization, search metadata, and local acquisition caches.

public static RemoteCatalogSourceSettings GetSettings(string id)

Returns the source's mutable settings entry, creating it in the current configuration when absent.

Parameters

Name Type
id System.String

Returns

AssetInventory.RemoteCatalogSourceSettings

public static bool IsRemote(Asset asset)

Indicates whether a package belongs to a remote catalog, independently of its download state.

Parameters

Name Type
asset AssetInventory.Asset

Returns

System.Boolean

public static bool IsRemote(AssetInfo info)

Indicates whether an asset or file information record belongs to a remote catalog.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.Boolean

public static string GetProviderId(Asset asset)

Returns a remote package's catalog registry identifier, or null for other package sources.

Parameters

Name Type
asset AssetInventory.Asset

Returns

System.String

public static string GetProviderId(AssetInfo info)

Returns the catalog registry identifier for remote asset information, or null for other sources.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.String

public static bool IsItem(AssetFile file)

True for an indexed file that belongs to a catalog item, false for package rows and other sources.

Parameters

Name Type
file AssetInventory.AssetFile

Returns

System.Boolean

public static bool HasDownloads(Asset package)

True once a package holds downloaded items, which also lists it among the user's own assets.

Parameters

Name Type
package AssetInventory.Asset

Returns

System.Boolean

public static bool HasDownloads(AssetInfo package)

Indicates whether a remote package has recorded download storage, without checking whether its cached contents still exist.

Parameters

Name Type
package AssetInventory.AssetInfo

Returns

System.Boolean

public static bool HasCachedDownloads(AssetInfo package)

True while those downloads are in the cache. Clearing the cache keeps a package among the user's own assets, ready to download again.

Parameters

Name Type
package AssetInventory.AssetInfo

Returns

System.Boolean

public static bool IsEnabled(string id)

Indicates whether the source is enabled in the current configuration; sources without a settings entry are disabled.

Parameters

Name Type
id System.String

Returns

System.Boolean

public static RemoteCatalogStatus GetStatus(string id)

Returns cached synchronization status, initialized from the active database when first requested.

Parameters

Name Type
id System.String

Returns

AssetInventory.RemoteCatalogStatus

public static void SetEnabled(string id, bool enabled)

Changes the saved enablement of an integrated source; disabling requests cancellation of its active operations.

Parameters

Name Type
id System.String
enabled System.Boolean
public static RemoteCatalogEdition GetEdition(string id)

The selected download edition of a source, or its default edition. Null when the source offers only one.

Parameters

Name Type
id System.String

Returns

AssetInventory.RemoteCatalogEdition

public static void SetEdition(string id, string edition)

Saves a source's selected edition, clears its remembered variant and cancels operations to invalidate stale source choices.

Parameters

Name Type
id System.String
edition System.String
public static void EnableRecommended()

Enables Poly Haven and ambientCG and saves the configuration without disabling other sources.

UpdateAsync(string, bool, CancellationToken, Action)

Section titled “UpdateAsync(string, bool, CancellationToken, Action)”
public static Task<RemoteCatalogUpdateResult> UpdateAsync(string sourceId = null, bool force = false, CancellationToken cancellationToken = default, Action<RemoteCatalogUpdateReport> progress = null)

Synchronizes metadata for enabled local-index sources, optionally restricted to one identifier, with progress and per-source errors; force bypasses the unchanged-revision shortcut.

Parameters

Name Type
sourceId System.String
force System.Boolean
cancellationToken System.Threading.CancellationToken
progress System.Action{AssetInventory.RemoteCatalogUpdateReport}

Returns

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

SearchAsync(string, string, CancellationToken)

Section titled “SearchAsync(string, string, CancellationToken)”
public static Task<IReadOnlyList<AssetInfo>> SearchAsync(string sourceId, string query, CancellationToken cancellationToken = default)

Fetches and persists the first provider page for an enabled source, returning the indexed items from that page.

Parameters

Name Type
sourceId System.String
query System.String
cancellationToken System.Threading.CancellationToken

Returns

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

public static void CancelSourceOperations(string providerId)

Requests cancellation of a source's active catalog, search and download operations and invalidates its search continuation context.

Parameters

Name Type
providerId System.String

FetchPreviewAsync(AssetInfo, CancellationToken, bool)

Section titled “FetchPreviewAsync(AssetInfo, CancellationToken, bool)”
public static Task<bool> FetchPreviewAsync(AssetInfo info, CancellationToken cancellationToken = default, bool refresh = false)

Stores the preview of a catalog item and returns whether one is available afterwards: the source thumbnail scaled to the preview size, or a preview rendered from a small representative file such as a font when the source offers no thumbnail. Refresh fetches it again.

Parameters

Name Type
info AssetInventory.AssetInfo
cancellationToken System.Threading.CancellationToken
refresh System.Boolean

Returns

System.Threading.Tasks.Task{System.Boolean}

public static RemoteDownloadProgress GetDownloadProgress(int remoteItemId)

The progress of the running download of a catalog item, or null when none is running.

Parameters

Name Type
remoteItemId System.Int32

Returns

AssetInventory.RemoteDownloadProgress

public static bool CancelDownload(int remoteItemId)

Stops the running download of a catalog item. Partial files are discarded; nothing is retained.

Parameters

Name Type
remoteItemId System.Int32

Returns

System.Boolean

FormatDownloadProgress(RemoteDownloadProgress)

Section titled “FormatDownloadProgress(RemoteDownloadProgress)”
public static string FormatDownloadProgress(RemoteDownloadProgress progress)

A short status of a download, such as "12.4 MB of 48.0 MB · 2.1 MB/s".

Parameters

Name Type
progress AssetInventory.RemoteDownloadProgress

Returns

System.String

public static bool CanAcquire(AssetInfo info)

Checks that an entry is a remote item with an integrated provider and is not marked unavailable at its source.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.Boolean

public static bool IsAcquired(AssetInfo info)

Indicates whether acquisition metadata matches a complete set of files in the currently configured extraction cache.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.Boolean

public static bool IsMaterialized(AssetInfo info)

Indicates whether an acquired catalog item or delivered file resolves to existing contents in the current extraction cache.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.Boolean

public static bool IsMaterialized(Asset package, AssetFile file)

Indicates whether a catalog item or delivered file resolves to existing contents in the package acquisition cache.

Parameters

Name Type
package AssetInventory.Asset
file AssetInventory.AssetFile

Returns

System.Boolean

public static string GetMaterializedPath(Asset package, AssetFile file)

Resolves a catalog item entry or delivered file within the current extraction cache, returning null when its acquisition or contents are missing or invalid.

Parameters

Name Type
package AssetInventory.Asset
file AssetInventory.AssetFile

Returns

System.String

public static string GetMaterializedPath(AssetInfo info)

Resolves the current cached entry or delivered file for a catalog item, returning null when no valid materialized path exists.

Parameters

Name Type
info AssetInventory.AssetInfo

Returns

System.String

GetVariantsAsync(AssetInfo, CancellationToken)

Section titled “GetVariantsAsync(AssetInfo, CancellationToken)”
public static Task<IReadOnlyList<RemoteDownloadVariant>> GetVariantsAsync(AssetInfo info, CancellationToken cancellationToken = default)

Resolves download manifests for a remote item using its indexed revision, selected edition and source credential, without downloading the listed payloads.

Parameters

Name Type
info AssetInventory.AssetInfo
cancellationToken System.Threading.CancellationToken

Returns

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

AcquireAsync(AssetInfo, string, CancellationToken)

Section titled “AcquireAsync(AssetInfo, string, CancellationToken)”
public static Task<string> AcquireAsync(AssetInfo info, string variantId = null, CancellationToken cancellationToken = default)

Downloads or reuses an item's chosen variant in the extraction cache, indexes its delivered files, and returns the materialized entry or file path.

Parameters

Name Type
info AssetInventory.AssetInfo
variantId System.String
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{System.String}

public static RemoteCatalogConfiguration Configuration { get; }

Returns

AssetInventory.RemoteCatalogConfiguration

public static bool IsAnyUpdating { get; }

True while any source is synchronizing its local catalog.

Returns

System.Boolean

public static event Action Changed

Notifies consumers when remote-source settings, synchronization status or acquisition state changes.

Returns

System.Action