Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Fix clear thumbs
KrzysztofPajak46f93d8280a3
diff --git a/src/Business/Grand.Business.Storage/Services/PictureService.cs b/src/Business/Grand.Business.Storage/Services/PictureService.csindex c5d982dc3..14688d4fb 100644--- a/src/Business/Grand.Business.Storage/Services/PictureService.cs+++ b/src/Business/Grand.Business.Storage/Services/PictureService.cs@@ -529,18 +529,18 @@ namespace Grand.Business.Storage.Servicespublic virtual async Task ClearThumbs(){const string searchPattern = "*.*";- string path = Path.Combine(_hostingEnvironment.WebRootPath, "content/images/thumbs");+ var path = _mediaFileStore.GetDirectoryInfo(Path.Combine("assets", "images", "thumbs"))?.PhysicalPath;- if (!System.IO.Directory.Exists(path))+ if (!Directory.Exists(path))return;- foreach (string str in System.IO.Directory.GetFiles(path, searchPattern, SearchOption.AllDirectories))+ foreach (var file in Directory.GetFiles(path, searchPattern, SearchOption.AllDirectories)){- if (str.Contains("placeholder.txt"))+ if (file.Contains("placeholder.txt"))continue;try{- File.Delete(await GetThumbPhysicalPath(str));+ File.Delete(file);}catch (Exception ex){