Facepunch / sbox-issues

176 stars 12 forks source link

`Package.FileSize` of searched map packages is always zero. #6155

Open youarereadingthis opened 3 months ago

youarereadingthis commented 3 months ago

Describe the bug

I am listing the file sizes of searched maps in my UI if they are > 0 but they never show, and logging the file size of them from the list of packages manually shows that they are all zero.

For context: this is in the editor.

To Reproduce

  1. Search a list of map packages.
  2. Log the FileSize for each of them.

Expected behavior

Searched packages should have their file size listed.

Media/Files

Here's the UI showing FileSize for demonstration purposes.

<div class="map-info">
    <div class="mb"> @Map.FileSize MB </div>
    <div class="likes"> <label>👍</label> @Map.VotesUp </div>
    <div class="dislikes"> <label>👎</label> @Map.VotesDown </div>
</div>

sbox-dev_ciqIlAmzM7

Additional context

No response

CarsonKompon commented 3 months ago

Is the .TotalSize of every revision in Package.FetchVersions() also zero?

youarereadingthis commented 3 months ago

Looping through all map search results and logging .TotalSize for all their versions prints out many long numbers, with only a couple of them from Construct being zero.

Seems like they are not MB but bytes. Ex: 897321358