mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 05:09:49 +02:00
Sync reason System.Reflection.MethodBase.GetCurrentMethod()?.Name
This commit is contained in:
@@ -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, GetType()) is { success: false } result)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), "Disable Id") 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, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
Log.Debug($"Downloaded chapter {chapter}.");
|
||||
|
@@ -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, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
@@ -73,7 +73,7 @@ public class RetrieveMangaChaptersFromMangaconnectorWorker(MangaConnectorId<Mang
|
||||
}
|
||||
}
|
||||
|
||||
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
@@ -35,7 +35,7 @@ public class MoveMangaLibraryWorker(Manga manga, FileLibrary toLibrary, IEnumera
|
||||
// Set new Path
|
||||
manga.Library = toLibrary;
|
||||
|
||||
if (await DbContext.Sync(CancellationToken, GetType()) is { success: false })
|
||||
if (await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false })
|
||||
return [];
|
||||
|
||||
// Create Jobs to move chapters from old to new Path
|
||||
|
@@ -19,7 +19,7 @@ public class RemoveOldNotificationsWorker(TimeSpan? interval = null, IEnumerable
|
||||
Log.Debug($"Removing {toRemove.Count} old notifications...");
|
||||
DbContext.RemoveRange(toRemove);
|
||||
|
||||
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
@@ -33,7 +33,7 @@ public class SendNotificationsWorker(TimeSpan? interval = null, IEnumerable<Base
|
||||
|
||||
Log.Debug("Notifications sent.");
|
||||
|
||||
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
@@ -28,7 +28,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab
|
||||
}
|
||||
}
|
||||
|
||||
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
@@ -37,7 +37,7 @@ public class UpdateMetadataWorker(TimeSpan? interval = null, IEnumerable<BaseWor
|
||||
}
|
||||
Log.Debug("Updated metadata.");
|
||||
|
||||
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
|
||||
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
|
||||
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
|
||||
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user