Fix #472
Some checks failed
Docker Image CI / build (push) Has been cancelled

Downloaded chapters filenames are not set in database
This commit is contained in:
2025-10-13 18:52:24 +02:00
parent b25cc3bddc
commit 2683d19806
2 changed files with 3 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ public class Chapter : Identifiable, IComparable<Chapter>
[StringLength(256)] public string? Title { get; private set; }
[StringLength(256)] public string? FileName { get; private set; }
[StringLength(256)] public string? FileName { get; internal set; }
public bool Downloaded { get; internal set; }

View File

@@ -164,7 +164,8 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId<Chapter> c
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(saveArchiveFilePath, UserRead | UserWrite | UserExecute | GroupRead | GroupWrite | GroupExecute );
DbContext.Entry(chapter).Property(c => c.Downloaded).CurrentValue = true;
chapter.Downloaded = true;
chapter.FileName = new FileInfo(saveArchiveFilePath).Name;
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");