Implement automatic sticker saving (#985)

* Implement automatic sticker saving

* Prevent multiple requests for same sticker or print
This commit is contained in:
Nekromateion
2024-11-26 05:36:02 +01:00
committed by GitHub
parent 654872fc30
commit c4a19966a4
7 changed files with 99 additions and 1 deletions

View File

@@ -592,5 +592,16 @@ namespace VRCX
return await ImageCache.SaveImageToFile(url, filePath);
}
public async Task<bool> SaveStickerToFile(string url, string path, string fileName)
{
var folder = Path.Combine(GetVRChatPhotosLocation(), "Stickers", MakeValidFileName(path));
Directory.CreateDirectory(folder);
var filePath = Path.Combine(folder, MakeValidFileName(fileName));
if (File.Exists(filePath))
return false;
return await ImageCache.SaveImageToFile(url, filePath);
}
}
}