Added common language enum. Fixed "romaji" spelling. More UI updates.

This commit is contained in:
2025-06-08 11:13:52 -04:00
parent 70513559cb
commit b5d22c3c7e
20 changed files with 224 additions and 55 deletions

View File

@@ -1,4 +1,5 @@
using MangaReader.Core.Metadata;
using MangaReader.Core.Common;
using MangaReader.Core.Metadata;
using MangaReader.Core.Sources.MangaDex.Api;
namespace MangaReader.Core.Sources.MangaDex.Metadata;
@@ -62,11 +63,11 @@ public class MangaDexMetadataProvider(IMangaDexClient mangaDexClient) : IMangaMe
if (attributes.AltTitles == null || attributes.AltTitles.Count == 0)
return [];
Dictionary<string, SourceMangaLanguage> languageIdMap = new()
Dictionary<string, Language> languageIdMap = new()
{
{ "en", SourceMangaLanguage.English },
{ "ja", SourceMangaLanguage.Japanese },
{ "ja-ro", SourceMangaLanguage.Romanji },
{ "en", Language.English },
{ "ja", Language.Japanese },
{ "ja-ro", Language.Romaji },
};
List<SourceMangaTitle> sourceMangaTitles = [];
@@ -75,7 +76,7 @@ public class MangaDexMetadataProvider(IMangaDexClient mangaDexClient) : IMangaMe
{
foreach (string alternateTitleKey in alternateTitle.Keys)
{
if (languageIdMap.TryGetValue(alternateTitleKey, out SourceMangaLanguage language) == false)
if (languageIdMap.TryGetValue(alternateTitleKey, out Language language) == false)
continue;
SourceMangaTitle sourceMangaTitle = new()

View File

@@ -45,7 +45,7 @@ public partial class MangaDexSearchProvider(IMangaDexClient mangaDexClient) : IM
if (thing.Count > 0)
{
Guid[] mangaGuids = thing.Select(x => x.Key).ToArray();
Guid[] mangaGuids = [.. thing.Select(x => x.Key)];
var reults = await GetCoverArtFileNamesAsync(mangaGuids, cancellationToken);
//var reults = await mangaDexClient.GetCoverArtAsync(mangaGuids, cancellationToken);
}