a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/pages] Remove old icon/banner when uploading a new one

+10
+10
Iceshrimp.Backend/Pages/Admin/Metadata.razor
··· 91 91 { 92 92 var req = new DriveFileCreationRequest { Filename = Model.IconFile.Name, IsSensitive = false, MimeType = "image/png" }; 93 93 var file = await Drive.StoreFileAsync(Model.IconFile.OpenReadStream(), ia, req, favicon: true); 94 + 95 + var oldId = await Meta.GetAsync(MetaEntity.IconFileId); 96 + if (oldId != null) 97 + await Drive.RemoveFileAsync(oldId); 98 + 94 99 await Meta.SetAsync(MetaEntity.IconFileId, file.Id); 95 100 } 96 101 if (Model.BannerFile != null) 97 102 { 98 103 var req = new DriveFileCreationRequest { Filename = Model.BannerFile.Name, IsSensitive = false, MimeType = Model.BannerFile.ContentType }; 99 104 var file = await Drive.StoreFileAsync(Model.BannerFile.OpenReadStream(), ia, req); 105 + 106 + var oldId = await Meta.GetAsync(MetaEntity.BannerFileId); 107 + if (oldId != null) 108 + await Drive.RemoveFileAsync(oldId); 109 + 100 110 await Meta.SetAsync(MetaEntity.BannerFileId, file.Id); 101 111 } 102 112