UgcItem Downloaded time

This commit is contained in:
James King 2022-08-30 14:48:03 +01:00
parent 886d9995ee
commit f91eee68a9
2 changed files with 19 additions and 3 deletions

View File

@ -77,9 +77,6 @@ public static bool Download( PublishedFileId fileId, bool highPriority = false )
progress?.Invoke( 0.0f );
if ( Download( fileId, true ) == false )
return item.IsInstalled;
// Steam docs about Download:
// If the return value is true then register and wait
// for the Callback DownloadItemResult_t before calling
@ -96,6 +93,9 @@ public static bool Download( PublishedFileId fileId, bool highPriority = false )
onDownloadStarted = r => downloadStarted = true;
OnDownloadItemResult += onDownloadStarted;
if ( Download( fileId, true ) == false )
return item.IsInstalled;
while ( downloadStarted == false )
{
if ( ct.IsCancellationRequested )

View File

@ -206,6 +206,22 @@ public long SizeBytes
}
}
/// <summary>
/// Time when the last update was downloaded
/// </summary>
public DateTime Downloaded
{
get
{
ulong size = 0;
uint ts = 0;
if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
return default;
return Epoch.ToDateTime( ts );
}
}
/// <summary>
/// If we're downloading our current progress as a delta betwen 0-1
/// </summary>