How can I get the download size of a content update without having to update the catalog first?
It seems I have to call Addressables.UpdateCatalogs in order to get the download size with Addressables.GetDownloadSizeAsync of any content that hasn’t been downloaded yet.
However, calling Addressables.UpdateCatalogs causes that any Addressables.Load call from then on will load the updated bundles from the server under the hood automagically. This isn’t the desired behavior I’m after.
I want to get the download size of a content update and ask the user “Do you want to download the latest content? Download size: 123 MB”.
If the users chooses “no”, I want to keep using the existing, already downloaded, bundles and catalog instead. No new bundle should be downloaded at any point. But due to the earlier UpdateCatalogs call, even when the user declined the update, Addressables downloads files when game code loads content with Addressables.LoadSceneAsync for example, where an update is available on the server.
If the user chooses “yes”, I would call Addressables.UpdateCatalog and Addressables.DownloadDependenciesAsync to download the content update.
I didn’t find out how to get the download size of a content update without modifying the local catalog.
@Peter77 Hi there, unfortunately the behavior that you’re describing is not possible with addressables as it is now. Because new catalogs are required to check the size of an update, and because UpdateCatalogs combines both downloading and updating the catalogs, once a user has updated the catalogs there is no way to “undo” the update and revert back to the previous state of the catalogs such as for the use case you described. That said, I talked about this with the team and we believe this is a good idea for a feature to support in the future. We’ve created a ticket for this and will make sure to take a look into it. Thank you for bringing this to our attention!
Hey, has there been any updates/implementations or workarounds regarding this?
I’ve tried GetDownloadSizeAsync() so many different ways but cant get it to work without updating the catalog first. Users should be able to view the download size and if there is enough storage space on their device then be given the option to update/download.
I managed to not make it auto download, but I’m not using UpdateCatalogs, I’m using LoadContentCatalogAsync. Then if the user selects not to download the update I call Addressables.RemoveResourceLocator(locator) where locator is the result from the LoadContentCatalogAsync returns.
Now what I’m missing is being able to play with the already downloaded content instead.
Alright so I’ve been able to fix this issue with a custom solution. I know that @Peter77 already moved on from Addressables, but if anyone is still looking into some of the features mentioned on this thread you can see my solution here: How to load already downloaded remote catalog without loading remote catalog? - Unity Engine - Unity Discussions this is for remote catalogs built on a separate project. Haven’t tested it with catalogs from the same project since I’m not using that workflow.
Is there an update on the ticket that was created for this? Can users get a download size first in order to opt to download/update a catalog? Or to check if there is enough free space on the device before downloading/updating?