mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-17 10:50:45 +02:00
Add ActionRecord DTO
Include all Data in ActionRecord return Add endpoints for returning actions related to manga and chapter Fix wrong syncs for ActionsContext
This commit is contained in:
@@ -50,13 +50,15 @@ public class DownloadCoverFromMangaconnectorWorker(MangaConnectorId<Manga> mcId,
|
||||
Log.Error($"Could not get Cover for MangaConnectorId {mangaConnectorId}.");
|
||||
return [];
|
||||
}
|
||||
MangaContext.Entry(mangaConnectorId.Obj).Property(m => m.CoverFileNameInCache).CurrentValue = coverFileName;
|
||||
|
||||
await MangaContext.Entry(mangaConnectorId).Reference(m => m.Obj).LoadAsync(CancellationToken);
|
||||
mangaConnectorId.Obj.CoverFileNameInCache = coverFileName;
|
||||
|
||||
if(await MangaContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } mangaContextException)
|
||||
Log.Error($"Failed to save database changes: {mangaContextException.exceptionMessage}");
|
||||
|
||||
ActionsContext.Actions.Add(new CoverDownloadedActionRecord(mcId.Obj, coverFileName));
|
||||
if(await MangaContext.Sync(CancellationToken, GetType(), "Download complete") is { success: false } actionsContextException)
|
||||
if(await ActionsContext.Sync(CancellationToken, GetType(), "Download complete") is { success: false } actionsContextException)
|
||||
Log.Error($"Failed to save database changes: {actionsContextException.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user