CAsset: GetIdentifier to get label or hex id

This commit is contained in:
Luke Dashjr 2019-01-06 05:53:13 +00:00 committed by Gregory Sanders
parent d81c9f7b3e
commit 047799cb12
3 changed files with 11 additions and 5 deletions

View file

@ -72,6 +72,13 @@ std::string CAssetsDir::GetLabel(const CAsset& asset) const
return GetMetadata(asset).GetLabel();
}
std::string CAssetsDir::GetIdentifier(const CAsset& asset) const
{
const std::string label = GetMetadata(asset).GetLabel();
if (!label.empty()) return label;
return asset.GetHex();
}
std::vector<CAsset> CAssetsDir::GetKnownAssets() const
{
std::vector<CAsset> knownAssets;