Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
C9Glax committed Oct 30, 2024
1 parent 02cf857 commit 4690394
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tranga/Jobs/JobBoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void LoadJobsList(HashSet<MangaConnector> connectors)
Regex idRex = new (@"(.*)\.json");

//Load json-job-files
foreach (FileInfo file in new DirectoryInfo(TrangaSettings.jobsFolderPath).EnumerateFiles().Where(fileInfo => idRex.IsMatch(fileInfo.Name)))
foreach (FileInfo file in new DirectoryInfo(TrangaSettings.jobsFolderPath).EnumerateFiles().Where(fileInfo => idRex.IsMatch(fileInfo.Name)))
{
Log($"Adding {file.Name}");
Job? job = JsonConvert.DeserializeObject<Job>(File.ReadAllText(file.FullName),
Expand Down Expand Up @@ -190,7 +190,7 @@ private void LoadJobsList(HashSet<MangaConnector> connectors)

string[] coverFiles = Directory.GetFiles(TrangaSettings.coverImageCache);
foreach(string fileName in coverFiles.Where(fileName => !GetAllCachedManga().Any(manga => manga.coverFileNameInCache == fileName)))
File.Delete(fileName);
File.Delete(fileName);
}

internal void UpdateJobFile(Job job, string? oldFile = null)
Expand Down Expand Up @@ -223,6 +223,8 @@ internal void UpdateJobFile(Job job, string? oldFile = null)
while(IsFileInUse(newJobFilePath))
Thread.Sleep(10);
File.WriteAllText(newJobFilePath, jobStr);
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(newJobFilePath, UserRead | UserWrite | GroupRead | OtherRead);
}
}

Expand Down

0 comments on commit 4690394

Please sign in to comment.