[Activity] Add CDN refresh

This commit is contained in:
2023-03-23 11:04:34 +01:00
parent b6897f7327
commit 79d9f16a8b
4 changed files with 26 additions and 7 deletions

19
Cocotte/Utils/CdnUtils.cs Normal file
View File

@@ -0,0 +1,19 @@
namespace Cocotte.Utils;
public class CdnUtils
{
/// <summary>
/// Use this to force discord media cache to fetch new content from CDN
/// </summary>
private const string QuerySuffix = $"?q={RandomSuffix}";
/// <summary>
/// Needs to be updated each time a media is updated on the CDN
/// </summary>
private const string RandomSuffix = "a57z45a";
public static string GetAsset(string assetName)
{
return $"https://sage.cdn.ilysix.fr/assets/Cocotte/{assetName}{QuerySuffix}";
}
}