question

ryan-3 avatar image
ryan-3 asked

Is there a way to get the list of files in file management via cloudscript?

Per this guide, our game has a catalog of songs set up so that a catalog item points to a song file. However, with multiple track authors managing our content, we've found it is really easy to get off sync; e.g. a song file gets removed from the file manager but the catalog is not updated to reflect that.

We have an audit cloudscript we can run to catch inconsistencies (such as tracks missing artists), and want to add detection for if a catalog item points to a file that isn't there. What is the best way to do that? I have considered:

1. We could theoretically call Get Content Download Url on each item and see if it fails; however that would go over the maximum API calls in a cloudscript since it would be doing one per song.

2. If I had a list of the filenames on the server (such as the one displayed under Content > File Management) I could easily check whether the song each item points to is actually there. Is there a way to get this list in cloudscript?

Thanks,

Ryan

sdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

We do have a admin API that can list all contents of a title: Admin/GetContentList, however, it’s currently not available in the server API set, which means that you cannot call this from CloudScript. For this reason, we recommend that you use Azure Function for this, where you are free to call any API you want, along with few more advantages, please navigate to this doc to learn more: PlayFab CloudScript using Azure Functions.

BTW, just a suggestion, why not also update the catalog item after a associated content is modified?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.