mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
CAsset: GetIdentifier to get label or hex id
This commit is contained in:
parent
d81c9f7b3e
commit
047799cb12
3 changed files with 11 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue