LibraryConnector-Updates work

Fixes #418
This commit is contained in:
2025-09-18 00:42:46 +02:00
parent 55fb37d62b
commit 5af1605c5b
16 changed files with 125 additions and 135 deletions

View File

@@ -2,7 +2,6 @@
using System.ComponentModel.DataAnnotations.Schema;
using log4net;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
namespace API.Schema.LibraryContext.LibraryConnectors;
@@ -18,7 +17,7 @@ public abstract class LibraryConnector : Identifiable
: base()
{
this.LibraryType = libraryType;
this.BaseUrl = baseUrl;
this.BaseUrl = baseUrl.TrimEnd('/', ' ');
this.Auth = auth;
this.Log = LogManager.GetLogger(GetType());
}
@@ -37,8 +36,8 @@ public abstract class LibraryConnector : Identifiable
public override string ToString() => $"{base.ToString()} {this.LibraryType} {this.BaseUrl}";
protected abstract void UpdateLibraryInternal();
internal abstract bool Test();
public abstract Task UpdateLibrary(CancellationToken ct);
internal abstract Task<bool> Test(CancellationToken ct);
}
public enum LibraryType : byte