Add LibraryConnector.Test to see if requests can be made to endpoint.
This commit is contained in:
parent
cee7870aad
commit
a56555eee4
@ -68,6 +68,14 @@ public class Kavita : LibraryConnector
|
|||||||
NetClient.MakePost($"{baseUrl}/api/Library/scan?libraryId={lib.id}", "Bearer", auth, logger);
|
NetClient.MakePost($"{baseUrl}/api/Library/scan?libraryId={lib.id}", "Bearer", auth, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal override bool Test()
|
||||||
|
{
|
||||||
|
foreach (KavitaLibrary lib in GetLibraries())
|
||||||
|
if (NetClient.MakePost($"{baseUrl}/api/Library/scan?libraryId={lib.id}", "Bearer", auth, logger))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches all libraries available to the user
|
/// Fetches all libraries available to the user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -32,6 +32,14 @@ public class Komga : LibraryConnector
|
|||||||
NetClient.MakePost($"{baseUrl}/api/v1/libraries/{lib.id}/scan", "Basic", auth, logger);
|
NetClient.MakePost($"{baseUrl}/api/v1/libraries/{lib.id}/scan", "Basic", auth, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal override bool Test()
|
||||||
|
{
|
||||||
|
foreach (KomgaLibrary lib in GetLibraries())
|
||||||
|
if (NetClient.MakePost($"{baseUrl}/api/v1/libraries/{lib.id}/scan", "Basic", auth, logger))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches all libraries available to the user
|
/// Fetches all libraries available to the user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -30,6 +30,7 @@ public abstract class LibraryConnector : GlobalBase
|
|||||||
this.libraryType = libraryType;
|
this.libraryType = libraryType;
|
||||||
}
|
}
|
||||||
public abstract void UpdateLibrary();
|
public abstract void UpdateLibrary();
|
||||||
|
internal abstract bool Test();
|
||||||
|
|
||||||
protected static class NetClient
|
protected static class NetClient
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user