mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-30 00:38:38 +00:00
Add some resource tests and other small changes (#638)
* Cleanup custom icon resources and add resource tests * Don't delete old custom icons
This commit is contained in:
parent
87ceca9c63
commit
ace3678da7
4 changed files with 105 additions and 49 deletions
|
@ -2,6 +2,7 @@
|
|||
using Discord;
|
||||
using LBPUnion.ProjectLighthouse.Configuration;
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.Files;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Levels;
|
||||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
|
@ -227,14 +228,7 @@ public class PhotosController : ControllerBase
|
|||
HashSet<string> photoResources = new(){photo.LargeHash, photo.SmallHash, photo.MediumHash, photo.PlanHash,};
|
||||
foreach (string hash in photoResources)
|
||||
{
|
||||
if (System.IO.File.Exists(Path.Combine("png", $"{hash}.png")))
|
||||
{
|
||||
System.IO.File.Delete(Path.Combine("png", $"{hash}.png"));
|
||||
}
|
||||
if (System.IO.File.Exists(Path.Combine("r", hash)))
|
||||
{
|
||||
System.IO.File.Delete(Path.Combine("r", hash));
|
||||
}
|
||||
FileHelper.DeleteResource(hash);
|
||||
}
|
||||
|
||||
this.database.Photos.Remove(photo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue