mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Save instance emojis
This commit is contained in:
@@ -257,5 +257,26 @@ namespace VRCX
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public async Task<string> SaveEmojiToFile(string url, string ugcFolderPath, string monthFolder, string fileName)
|
||||
{
|
||||
var folder = Path.Join(GetUGCPhotoLocation(ugcFolderPath), "Emoji", MakeValidFileName(monthFolder));
|
||||
Directory.CreateDirectory(folder);
|
||||
var filePath = Path.Join(folder, MakeValidFileName(fileName));
|
||||
if (File.Exists(filePath))
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
await ImageCache.SaveImageToFile(url, filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex, "Failed to save print to file");
|
||||
return null;
|
||||
}
|
||||
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user