From 574bba81c12ffbcfb4760e813847d94c0b7519a6 Mon Sep 17 00:00:00 2001 From: "Amir.H Khademi" Date: Thu, 15 Feb 2024 12:38:41 +0330 Subject: [PATCH] fix summery in digi scraper --- .version | 2 +- NetinaShop.Infrastructure/Services/Scrapers/DigikalaScraper.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.version b/.version index edb4948..fe4aaa4 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.5.11.18 \ No newline at end of file +0.5.11.19 \ No newline at end of file diff --git a/NetinaShop.Infrastructure/Services/Scrapers/DigikalaScraper.cs b/NetinaShop.Infrastructure/Services/Scrapers/DigikalaScraper.cs index 88eb1ec..34b7cb4 100644 --- a/NetinaShop.Infrastructure/Services/Scrapers/DigikalaScraper.cs +++ b/NetinaShop.Infrastructure/Services/Scrapers/DigikalaScraper.cs @@ -6,6 +6,7 @@ using NetinaShop.Repository.Repositories.Base.Contracts; using System.Linq; using MediatR; using Microsoft.EntityFrameworkCore; +using Microsoft.IdentityModel.Tokens; using NetinaShop.Domain.Entities.Brands; using NetinaShop.Domain.Entities.ProductCategories; @@ -46,6 +47,8 @@ public class DigikalaScraper : IDigikalaScraper .TableNoTracking .FirstOrDefaultAsync(p => p.PersianName.ToLower().Trim().Contains(productName.ToLower().Trim()), cancellationToken); var newSummery = digiProduct.seo.description.Replace("فروشگاه اینترنتی دیجی\u200cکالا", "فروشگاه اینترنتی وسمه"); + if (dbProduct != null && !dbProduct.Summery.IsNullOrEmpty()) + newSummery = dbProduct.Summery; var specifications = new List(); foreach (var specification in digiProduct.product.specifications) {