mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 06:35:49 +03:00
Support return UGC metadata in query
This commit is contained in:
parent
ed45805029
commit
af36007f5d
@ -365,10 +365,15 @@ public async Task<bool> RemoveFavorite()
|
||||
public ulong NumSecondsPlayedDuringTimePeriod { get; internal set; }
|
||||
public ulong NumPlaytimeSessionsDuringTimePeriod { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// The URL to the preview image for this item
|
||||
/// </summary>
|
||||
public string PreviewImageUrl { get; internal set; }
|
||||
/// <summary>
|
||||
/// The URL to the preview image for this item
|
||||
/// </summary>
|
||||
public string PreviewImageUrl { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// The metadata string for this item
|
||||
/// </summary>
|
||||
public string Metadata { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Edit this item
|
||||
|
@ -151,6 +151,7 @@ public Query WithFileId( params PublishedFileId[] files )
|
||||
CachedData = result.Value.CachedData,
|
||||
ReturnsKeyValueTags = WantsReturnKeyValueTags ?? false,
|
||||
ReturnsDefaultStats = WantsDefaultStats ?? true, //true by default
|
||||
ReturnsMetadata = WantsReturnMetadata ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ public struct ResultPage : System.IDisposable
|
||||
|
||||
internal bool ReturnsKeyValueTags;
|
||||
internal bool ReturnsDefaultStats;
|
||||
internal bool ReturnsMetadata;
|
||||
|
||||
public IEnumerable<Item> Entries
|
||||
{
|
||||
@ -63,10 +64,17 @@ public IEnumerable<Item> Entries
|
||||
}
|
||||
}
|
||||
|
||||
if (ReturnsMetadata)
|
||||
{
|
||||
string metadata;
|
||||
if (SteamUGC.Internal.GetQueryUGCMetadata(Handle, i, out metadata))
|
||||
{
|
||||
item.Metadata = metadata;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO GetQueryUGCAdditionalPreview
|
||||
// TODO GetQueryUGCChildren
|
||||
// TODO GetQueryUGCMetadata
|
||||
|
||||
|
||||
yield return item;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user