#409 fixes
This commit is contained in:
parent
7e81344e81
commit
0b15775ef6
@ -367,7 +367,15 @@ namespace RMuseum.Services.Implementation
|
||||
List<PDFPage> pages = new List<PDFPage>();
|
||||
string pdfFilePath = job.ResourceNumber;
|
||||
string intermediateFolder = Path.Combine(Path.GetDirectoryName(pdfFilePath), Path.GetFileNameWithoutExtension(pdfFilePath));
|
||||
Directory.CreateDirectory(intermediateFolder);
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(intermediateFolder);
|
||||
}
|
||||
catch
|
||||
{
|
||||
intermediateFolder = Path.Combine(Path.GetDirectoryName(pdfFilePath), $"{pdfBook.Id}-catch");
|
||||
}
|
||||
|
||||
List<string> fileNames = new List<string>();
|
||||
int imageOrder = 1;
|
||||
using (FileStream fs = File.OpenRead(pdfFilePath))
|
||||
|
||||
@ -367,7 +367,7 @@ namespace RMuseum.Services.Implementation
|
||||
model.Language = tagValueCleaned;
|
||||
tagName = "Language";
|
||||
|
||||
if (tagValueCleaned != "فارسی")
|
||||
if (!tagValueCleaned.Contains("فارسی"))
|
||||
{
|
||||
job.EndTime = DateTime.Now;
|
||||
job.Status = ImportJobStatus.Failed;
|
||||
@ -525,6 +525,8 @@ namespace RMuseum.Services.Implementation
|
||||
{
|
||||
if (result.IsSuccessStatusCode)
|
||||
{
|
||||
string fileName = (1 + await context.PDFBooks.MaxAsync(p => p.Id)).ToString().PadLeft(8, '0') + "-soha.pdf";
|
||||
/*
|
||||
string fileName = string.Empty;
|
||||
if (result.Content.Headers.ContentDisposition != null)
|
||||
{
|
||||
@ -540,7 +542,7 @@ namespace RMuseum.Services.Implementation
|
||||
{
|
||||
fileName = Path.GetFileNameWithoutExtension(fileName).Substring(0, 64) + ".pdf";
|
||||
}
|
||||
|
||||
*/
|
||||
model.LocalImportingPDFFilePath = Path.Combine(_imageFileService.ImageStoragePath, fileName);
|
||||
if (File.Exists(model.LocalImportingPDFFilePath))
|
||||
File.Delete(model.LocalImportingPDFFilePath);
|
||||
|
||||
@ -390,7 +390,7 @@ namespace RMuseum.Services.Implementation
|
||||
model.Language = tagValueCleaned;
|
||||
tagName = "Language";
|
||||
|
||||
if (tagValueCleaned != "فارسی")
|
||||
if (!tagValueCleaned.Contains("فارسی"))
|
||||
{
|
||||
job.EndTime = DateTime.Now;
|
||||
job.Status = ImportJobStatus.Failed;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user