From ecc14dd518ae250385454485067dbaf5e504a6c7 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Fri, 10 Jun 2022 10:08:00 +0430 Subject: [PATCH] docs: bug fix --- .../GanjoorService-Maintenance.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Maintenance.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Maintenance.cs index 5e154533..6dae0780 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Maintenance.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Maintenance.cs @@ -685,11 +685,18 @@ namespace RMuseum.Services.Implementation { catPage = await context.GanjoorPages.AsNoTracking().Where(p => p.GanjoorPageType == GanjoorPageType.PoetPage && p.CatId == poem.CatId).SingleOrDefaultAsync(); } - poem.FullTitle = $"{catPage.FullTitle} » {poem.Title}"; - context.Update(poem); + var title = $"{catPage.FullTitle} » {poem.Title}"; + if(title != poem.FullTitle) + { + poem.FullTitle = title; + context.Update(poem); + } var page = await context.GanjoorPages.Where(p => p.Id == poem.Id).SingleOrDefaultAsync(); - page.FullTitle = poem.FullTitle; - context.Update(page); + if(title != page.FullTitle) + { + page.FullTitle = title; + context.Update(page); + } } await jobProgressServiceEF.UpdateJob(job.Id, 100, "", true);