docs: fixes for breaking a poem to two poems issues

This commit is contained in:
Hamid Reza Mohammadi 2022-06-03 19:48:22 +04:30
parent 237d6b0c82
commit 5b827703cd
2 changed files with 9 additions and 1 deletions

View File

@ -25,6 +25,9 @@ namespace RMuseum.Services.Implementation
}
var dbMainPoem = await context.GanjoorPoems.Include(p => p.GanjoorMetre).Where(p => p.Id == poemId).SingleOrDefaultAsync();
if(dbMainPoem.Title.IndexOf(poemTitleStaticPart) != 0)
return new RServiceResult<int>(-1, $"dbMainPoem.Title.IndexOf(poemTitleStaticPart) != 0");
if (!int.TryParse(dbMainPoem.UrlSlug.Substring("sh".Length), out int mainPoemSlugNumber))
return new RServiceResult<int>(-1, $"slug error for the last poem in the category: {dbMainPoem.UrlSlug}");

View File

@ -2496,7 +2496,12 @@ namespace RMuseum.Services.Implementation
var job = (await jobProgressServiceEF.NewJob($"Breaking poem {poem.FullTitle}", "Query data")).Result;
try
{
await _BreakPoemAsync(context, poemId, vOrder, userId, poem, parentPage, poemTitleStaticPart);
var res = await _BreakPoemAsync(context, poemId, vOrder, userId, poem, parentPage, poemTitleStaticPart);
if(!string.IsNullOrEmpty(res.ExceptionString))
{
await jobProgressServiceEF.UpdateJob(job.Id, 100, "", false, res.ExceptionString);
}
await jobProgressServiceEF.UpdateJob(job.Id, 100, "", true);
}
catch (Exception exp)