Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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?