Better sync log

This commit is contained in:
2025-09-18 02:04:01 +02:00
parent c199f37b14
commit 429cd2284f
18 changed files with 30 additions and 29 deletions

View File

@@ -67,7 +67,7 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId<Chapter> c
{
Log.Info($"No imageUrls for chapter {chapter}");
mangaConnectorId.UseForDownload = false; // Do not try to download from this again
if(await DbContext.Sync(CancellationToken) is { success: false } result)
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } result)
Log.Error(result.exceptionMessage);
return [];
}
@@ -132,7 +132,7 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId<Chapter> c
Directory.Delete(tempFolder, true); //Cleanup
DbContext.Entry(chapter).Property(c => c.Downloaded).CurrentValue = true;
if(await DbContext.Sync(CancellationToken) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
Log.Debug($"Downloaded chapter {chapter}.");

View File

@@ -37,7 +37,7 @@ public class DownloadCoverFromMangaconnectorWorker(MangaConnectorId<Manga> mcId,
}
DbContext.Entry(mangaConnectorId.Obj).Property(m => m.CoverFileNameInCache).CurrentValue = coverFileName;
if(await DbContext.Sync(CancellationToken) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];

View File

@@ -73,7 +73,7 @@ public class RetrieveMangaChaptersFromMangaconnectorWorker(MangaConnectorId<Mang
}
}
if(await DbContext.Sync(CancellationToken) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];