Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Content.Statistics is null when Getting content by the trend type "Most Downloaded"?

Discussion in 'Unity User-Generated Content' started by Tirt, Jun 28, 2023.

  1. Tirt

    Tirt

    Joined:
    Jul 11, 2022
    Posts:
    9
    Is this intentional?

    Getting content in a list using "GetContentTrendsAsync" is very useful:
    Example:
    Code (CSharp):
    1.  private async Task<List<Content>> GetContentTrendListAsync(
    2.         ContentTrendType trendType,
    3.         int pageIndex,
    4.         int contentPerPage
    5. )
    6. {
    7.         int offset = pageIndex * contentPerPage;
    8.         int limit = (pageIndex + 1) * contentPerPage;
    9.  
    10.         var contents = await UgcService.Instance.GetContentTrendsAsync(
    11.             new GetContentTrendsArgs(trendType) { Offset = offset, Limit = limit }
    12.         );
    13.  
    14.         Debug.Log($"Gathered contents! {contents.Results.Count}");
    15.  
    16.         return contents.Results;
    17. }
    However, accessing content.Results.Statistics is null when the trend type is "ContentTrendType.MostDownloaded" and not when it is "ContentTrendType.Popular" (I haven't tested other ones though)
     
  2. Tirt

    Tirt

    Joined:
    Jul 11, 2022
    Posts:
    9
    Sorry had my references mixed up. In ContentTrendType.Newest, why is any Content.Statistics variable null?
     
  3. Tirt

    Tirt

    Joined:
    Jul 11, 2022
    Posts:
    9
    Ok, after some testing and playing around. It seems that Content.Statistics is null until the content is interacted with (downloaded, subbed or rated). I that intentional?