2
0

Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into cuttingedge

This commit is contained in:
Glax 2024-04-25 20:46:32 +02:00
commit d32d5976ee
5 changed files with 23 additions and 3 deletions

View File

@ -35,6 +35,7 @@ public class UpdateMetadata : Job
this.manga = manga.WithMetadata(updatedManga); this.manga = manga.WithMetadata(updatedManga);
this.manga.SaveSeriesInfoJson(settings.downloadLocation, true); this.manga.SaveSeriesInfoJson(settings.downloadLocation, true);
this.mangaConnector.CopyCoverFromCacheToDownloadLocation(manga);
this.progressToken.Complete(); this.progressToken.Complete();
} }
else else

View File

@ -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>

View File

@ -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>

View File

@ -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
{ {

View File

@ -20,7 +20,7 @@ public struct Manga
public string[] tags { get; private set; } public string[] tags { get; private set; }
// ReSharper disable once UnusedAutoPropertyAccessor.Global // ReSharper disable once UnusedAutoPropertyAccessor.Global
public string? coverUrl { get; private set; } public string? coverUrl { get; private set; }
public string? coverFileNameInCache { get; } public string? coverFileNameInCache { get; private set; }
// ReSharper disable once UnusedAutoPropertyAccessor.Global // ReSharper disable once UnusedAutoPropertyAccessor.Global
public Dictionary<string,string> links { get; } public Dictionary<string,string> links { get; }
// ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once MemberCanBePrivate.Global
@ -88,7 +88,8 @@ public struct Manga
status = newManga.status, status = newManga.status,
releaseStatus = newManga.releaseStatus, releaseStatus = newManga.releaseStatus,
websiteUrl = newManga.websiteUrl, websiteUrl = newManga.websiteUrl,
year = newManga.year year = newManga.year,
coverFileNameInCache = coverFileNameInCache
}; };
} }
@ -103,6 +104,7 @@ public struct Manga
this.sortName == compareManga.sortName && this.sortName == compareManga.sortName &&
this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) && this.latestChapterAvailable.Equals(compareManga.latestChapterAvailable) &&
this.authors.All(a => compareManga.authors.Contains(a)) && this.authors.All(a => compareManga.authors.Contains(a)) &&
(this.coverFileNameInCache??"").Equals(compareManga.coverFileNameInCache) &&
(this.websiteUrl??"").Equals(compareManga.websiteUrl) && (this.websiteUrl??"").Equals(compareManga.websiteUrl) &&
this.tags.All(t => compareManga.tags.Contains(t)); this.tags.All(t => compareManga.tags.Contains(t));
} }