Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This assetpoolfiles object provides direct access to the files for assets in the pool.

assetrealizer IDL

Code Block
languagejs
interface AssetPoolFiles {                                                                                                                                                                                   
    AssetPoolFiles(AssetPool pool, AssetList assets);                                                                                                                                                        
    Promise<String> getPath(String assetName);                                                                                                                                                               
    Promise<AssetInfo> getInfo(String assetName);                                                                                                                                                            
    Promise<void> moveFileIntoPool(String sourceFileName, String destinationAssetName);                                                                                                                          
}                                                                                                                                                                                                            

Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
minLevel1
maxLevel35
outlinefalse
indent20px
typelist
printablefalse


Object Creation

To create an assetpoolfiles object, you will first need to create an assetpool instance and download files to it using an assetpoolfetcher instance. Then, load the brightsign/assetrealizer module using the require() method, and create an instance of the assetrealizer class using the assetpool instance and the destination directory for realization.

Code Block
languagejs
const AssetPoolClass = require("@brightsign/assetpool");
let assetPool = new AssetPoolClass("SD:/pool");
  
const AssetPoolFilesClass = require("@brightsign/assetpoolfiles");
let assetPoolFiles = new AssetPoolFilesClass(assetPool, assetCollection);

AssetPoolFiles

Use this interface to gain access to information about the files for assets in the pool.

getPath()
Code Block
languagejs
Promise<String> getPath(String assetName)

Returns the full path to the file in the pool that corresponds to the named asset. This can be used to read, play or execute the corresponding asset as required. You must not modify the file since this will change its hash.

getInfo()
Code Block
languagejs
Promise<AssetInfo> getInfo(String assetName)

Returns the AssetInfo for the named asset if it is present in the pool. If the asset is not present then the returned promise is rejected.

moveFileIntoPool()
Code Block
languagejs
Promise<void> moveFileIntoPool(String sourceFileName, String destinationAssetName)

Move an existing file on the same storage device as the pool into the pool as the asset with the corresponding name. This is a quick operation because the hash is not checked. Note that this method does not cause any pruning of assets already in the pool to take place (although it may cause a subsequent operation that can prune the pool to do so.) This method is only rarely useful.