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:
@@ -71,7 +71,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
//TODO Path check
|
||||
library.BasePath = newBasePath;
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
//TODO Name check
|
||||
library.LibraryName = newName;
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
Schema.MangaContext.FileLibrary library = new (requestData.BasePath, requestData.LibraryName);
|
||||
context.FileLibraries.Add(library);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
|
||||
return TypedResults.Created(string.Empty, library.Key);
|
||||
@@ -140,7 +140,7 @@ public class FileLibraryController(MangaContext context) : Controller
|
||||
|
||||
context.FileLibraries.Remove(library);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ public class LibraryConnectorController(LibraryContext context) : Controller
|
||||
|
||||
context.LibraryConnectors.Add(connector);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Created(string.Empty, connector.Key);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class LibraryConnectorController(LibraryContext context) : Controller
|
||||
|
||||
context.LibraryConnectors.Remove(connector);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ public class MaintenanceController(MangaContext mangaContext) : Controller
|
||||
|
||||
mangaContext.Mangas.RemoveRange(noDownloads);
|
||||
|
||||
if(await mangaContext.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await mangaContext.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ public class MangaConnectorController(MangaContext context) : Controller
|
||||
|
||||
connector.Enabled = Enabled;
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@@ -154,7 +154,7 @@ public class MangaController(MangaContext context) : Controller
|
||||
|
||||
context.Mangas.Remove(manga);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
@@ -420,7 +420,7 @@ public class MangaController(MangaContext context) : Controller
|
||||
return TypedResults.NotFound(nameof(MangaId));
|
||||
|
||||
manga.IgnoreChaptersBefore = chapterThreshold;
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
|
||||
return TypedResults.Ok();
|
||||
@@ -488,7 +488,7 @@ public class MangaController(MangaContext context) : Controller
|
||||
}
|
||||
|
||||
mcId.UseForDownload = IsRequested;
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
|
||||
DownloadCoverFromMangaconnectorWorker downloadCover = new(mcId);
|
||||
|
@@ -91,7 +91,7 @@ public class MetadataFetcherController(MangaContext context) : Controller
|
||||
MetadataEntry entry = fetcher.CreateMetadataEntry(manga, Identifier);
|
||||
context.MetadataEntries.Add(entry);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok(entry);
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class MetadataFetcherController(MangaContext context) : Controller
|
||||
|
||||
context.Remove(entry);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ public class NotificationConnectorController(NotificationsContext context) : Con
|
||||
context.NotificationConnectors.Add(newConnector);
|
||||
context.Notifications.Add(new ("Added new Notification Connector!", newConnector.Name, NotificationUrgency.High));
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Created(string.Empty, newConnector.Name);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class NotificationConnectorController(NotificationsContext context) : Con
|
||||
|
||||
context.NotificationConnectors.Remove(connector);
|
||||
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType()) is { success: false } result)
|
||||
if(await context.Sync(HttpContext.RequestAborted, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } result)
|
||||
return TypedResults.InternalServerError(result.exceptionMessage);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
Reference in New Issue
Block a user