From 804c3489047e9384587da880964078c4b046ba01 Mon Sep 17 00:00:00 2001 From: MonkAlex <3amepob@gmail.com> Date: Fri, 8 May 2020 23:09:54 +0400 Subject: [PATCH] Release 1.49.8.59 --- CHANGELOG.md | 6 ++++ .../ViewModel/Explorer/LibraryViewModel.cs | 2 +- README.md | 2 +- .../Convertation/HentaichanFrom48To49.cs | 33 +++++++++++++++++++ Sites/Hentaichan.me/HentaichanLogin.cs | 2 +- Sites/Hentaichan.me/Parser.cs | 9 +++-- Tests/Tests.Entities/Cache.json | 6 ++-- .../Manga/HentaichanStructure.cs | 18 +++++----- Tests/Tests.Entities/MangaInfos.cs | 4 +-- Tests/Tests.Entities/Search/Henchan.cs | 2 +- VersionInfo.cs | 2 +- 11 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 Sites/Hentaichan.me/Convertation/HentaichanFrom48To49.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ed8ac2..2b5f8dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # История версий +*** +## 1.49.8.59 — 2020-05-08 + +### Исправлено +* Актуализирован адрес https://henchan.pro/. + *** ## 1.49.7.54 — 2020-04-30 diff --git a/MangaReader.Avalonia/ViewModel/Explorer/LibraryViewModel.cs b/MangaReader.Avalonia/ViewModel/Explorer/LibraryViewModel.cs index cac5d681..879511be 100644 --- a/MangaReader.Avalonia/ViewModel/Explorer/LibraryViewModel.cs +++ b/MangaReader.Avalonia/ViewModel/Explorer/LibraryViewModel.cs @@ -101,7 +101,7 @@ await Dispatcher.UIThread.InvokeAsync(() => public void ResetView() { - Items.Edit(updater => + Items?.Edit(updater => { var oldItems = Items.Items; updater.Clear(); diff --git a/README.md b/README.md index 34aca586..a1bb7857 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ На текущий момент поддерживаются: 1. [ReadManga](https://readmanga.me) 2. [MintManga](https://mintmanga.live) - 3. [Hentaichan](https://h-chan.me/) + 3. [Hentaichan](https://henchan.pro/) 4. [Acomics](https://acomics.ru) 5. [Mangachan](https://manga-chan.me/) 6. [Hentai2Read](https://hentai2read.com//) diff --git a/Sites/Hentaichan.me/Convertation/HentaichanFrom48To49.cs b/Sites/Hentaichan.me/Convertation/HentaichanFrom48To49.cs new file mode 100644 index 00000000..4a15287d --- /dev/null +++ b/Sites/Hentaichan.me/Convertation/HentaichanFrom48To49.cs @@ -0,0 +1,33 @@ +using System; +using System.Threading.Tasks; +using MangaReader.Core.Convertation; +using MangaReader.Core.Convertation.Primitives; +using MangaReader.Core.NHibernate; +using MangaReader.Core.Services.Config; + +namespace Hentaichan.Convertation +{ + public class HentaichanFrom48To49 : ConfigConverter + { + protected override async Task ProtectedConvert(IProcess process) + { + using (var context = Repository.GetEntityContext()) + { + var setting = ConfigStorage.GetPlugin().GetSettings(); + var oldMainUri = new Uri("https://h-chan.me/"); + var mainUri = new Uri("https://henchan.pro/"); + if (setting != null && Equals(oldMainUri, setting.MainUri)) + { + setting.MainUri = mainUri; + await context.Save(setting).ConfigureAwait(false); + } + } + } + + public HentaichanFrom48To49() + { + this.Version = new Version(1, 49, 8); + this.Name = "Обновляем ссылки на henchan.pro..."; + } + } +} diff --git a/Sites/Hentaichan.me/HentaichanLogin.cs b/Sites/Hentaichan.me/HentaichanLogin.cs index 00462403..0425a917 100644 --- a/Sites/Hentaichan.me/HentaichanLogin.cs +++ b/Sites/Hentaichan.me/HentaichanLogin.cs @@ -86,7 +86,7 @@ await Task.WhenAll(mangas.Select(async m => public HentaichanLogin() { // Адрес может быть переопределен в базе. Это только дефолтное значение. - this.MainUri = new Uri(@"https://h-chan.me/"); + this.MainUri = new Uri(@"https://henchan.pro/"); } } } diff --git a/Sites/Hentaichan.me/Parser.cs b/Sites/Hentaichan.me/Parser.cs index 548bf8b2..d7dd6753 100644 --- a/Sites/Hentaichan.me/Parser.cs +++ b/Sites/Hentaichan.me/Parser.cs @@ -134,6 +134,11 @@ public override async Task UpdateContent(IManga manga) }); } } + else + { + // Раз не нашли других глав - качаем хотя бы эту. + chapters.Add(new ChapterDto(uri, manga.ServerName) { Number = 0 }); + } } else { @@ -184,9 +189,9 @@ private async Task> GetPageWithRedirect(Uri uri) public override UriParseResult ParseUri(Uri uri) { - // Manga : https://h-chan.me/manga/14212-love-and-devil-glava-25.html + // Manga : https://henchan.pro/manga/14212-love-and-devil-glava-25.html // Volume : - - // Chapter : https://h-chan.me/online/14212-love-and-devil-glava-25.html + // Chapter : https://henchan.pro/online/14212-love-and-devil-glava-25.html // Page : - var hosts = ConfigStorage.Plugins diff --git a/Tests/Tests.Entities/Cache.json b/Tests/Tests.Entities/Cache.json index 812c6e8a..7b456a6d 100644 --- a/Tests/Tests.Entities/Cache.json +++ b/Tests/Tests.Entities/Cache.json @@ -16,7 +16,7 @@ "Status": "https://acomics.ru/~supersciencefriends\r\n\r\nАвтор оригинала: Tinman Creative Studios\r\nПереводчик: CrownedPenguin\r\nКоличество выпусков: 44\r\nКоличество подписчиков: 282\r\nОфициальный сайт: http://supersciencefriends.com/2099/\r\nВозрастной рейтинг: Parents strongly cautioned (Не рекомендуется лицам до 13 лет)\r\nЛицензия: Нет лицензии или не CC\r\n" }, { - "Uri": "https://h-chan.me/manga/12850-twisted-intent-chast-1.html", + "Uri": "https://henchan.pro/manga/12850-twisted-intent-chast-1.html", "FolderSize": 16369623, "FilesInFolder": 49, "AllFilesUnique": true, @@ -24,7 +24,7 @@ "Status": "Серия League of Legends\r\nАвтор OptionalTypo\r\nПереводчик TheMaximchik\r\nЯзык На русском\r\n" }, { - "Uri": "https://h-chan.me/manga/14212-love-and-devil-glava-25.html", + "Uri": "https://henchan.pro/manga/14212-love-and-devil-glava-25.html", "FolderSize": 0, "FilesInFolder": 0, "AllFilesUnique": false, @@ -95,4 +95,4 @@ "Description": "4-кадровая манга дополнительно включенная в тома манги \"Город,в котором ты живешь\"", "Status": "Томов: 1\r\nПеревод: завершен\r\nЖанры: повседневность, комедия\r\nКатегория: Ёнкома\r\nАвтор: Сэо Кодзи\r\nГод выпуска: 2008\r\nИздательство: Kodansha\r\nПереводчик: Aoshi Shinomori\r\n" } -] \ No newline at end of file +] diff --git a/Tests/Tests.Entities/Manga/HentaichanStructure.cs b/Tests/Tests.Entities/Manga/HentaichanStructure.cs index cbb56a7d..0432d06a 100644 --- a/Tests/Tests.Entities/Manga/HentaichanStructure.cs +++ b/Tests/Tests.Entities/Manga/HentaichanStructure.cs @@ -15,7 +15,7 @@ public class HentaichanStructure : TestClass [Test] public async Task AddHentaichanMultiPages() { - var manga = await GetManga("https://h-chan.me/manga/14212-love-and-devil-glava-25.html").ConfigureAwait(false); + var manga = await GetManga("https://henchan.pro/manga/14212-love-and-devil-glava-25.html").ConfigureAwait(false); Assert.AreEqual(25, manga.Chapters.Count); Assert.IsTrue(manga.HasChapters); } @@ -23,7 +23,7 @@ public async Task AddHentaichanMultiPages() [Test] public async Task AddHentaichanOneChapter() { - var manga = await GetManga("https://h-chan.me/manga/15131-chuui-horeru-to-yakui-kara.html").ConfigureAwait(false); + var manga = await GetManga("https://henchan.pro/manga/15131-chuui-horeru-to-yakui-kara.html").ConfigureAwait(false); Assert.AreEqual(1, manga.Chapters.Count); Assert.IsTrue(manga.HasChapters); } @@ -31,7 +31,7 @@ public async Task AddHentaichanOneChapter() [Test] public async Task AddHentaichanSubdomain() { - var manga = await GetManga("https://h-chan.me/manga/23083-ponpharse-tokubetsu-hen-chast-1.html").ConfigureAwait(false); + var manga = await GetManga("https://henchan.pro/manga/23083-ponpharse-tokubetsu-hen-chast-1.html").ConfigureAwait(false); Assert.AreEqual(2, manga.Chapters.Count); Assert.IsTrue(manga.HasChapters); Assert.AreEqual(1, manga.Chapters.First().Number); @@ -54,27 +54,27 @@ public async Task ParsingDoublesInChapterName() public async Task HentaichanNameParsing() { // Спецсимвол \ - await TestNameParsing("https://h-chan.me/manga/14504-lets-play-lovegames-shall-we-glava-1.html", + await TestNameParsing("https://henchan.pro/manga/14504-lets-play-lovegames-shall-we-glava-1.html", "Let's Play Lovegames, Shall We?").ConfigureAwait(false); // Спецсимвол # и одна глава - await TestNameParsing("https://h-chan.me/manga/15109-exhibitionist-renko-chan.html", + await TestNameParsing("https://henchan.pro/manga/15109-exhibitionist-renko-chan.html", "#Exhibitionist Renko-chan").ConfigureAwait(false); // Символ звездочки * - await TestNameParsing("https://h-chan.me/manga/15131-chuui-horeru-to-yakui-kara.html", + await TestNameParsing("https://henchan.pro/manga/15131-chuui-horeru-to-yakui-kara.html", "*Chuui* Horeru to Yakui kara").ConfigureAwait(false); // Символ / - await TestNameParsing("https://h-chan.me/manga/10535-blush-dc.-glava-1.html", + await TestNameParsing("https://henchan.pro/manga/10535-blush-dc.-glava-1.html", "/Blush-DC.").ConfigureAwait(false); // На всякий случай - await TestNameParsing("https://h-chan.me/manga/23083-ponpharse-tokubetsu-hen-chast-1.html", + await TestNameParsing("https://henchan.pro/manga/23083-ponpharse-tokubetsu-hen-chast-1.html", "Ponpharse - Tokubetsu Hen").ConfigureAwait(false); // Манга требующая регистрации для просмотра - await TestNameParsing("https://h-chan.me/manga/14212-love-and-devil-glava-25.html", + await TestNameParsing("https://henchan.pro/manga/14212-love-and-devil-glava-25.html", "Love and Devil").ConfigureAwait(false); } diff --git a/Tests/Tests.Entities/MangaInfos.cs b/Tests/Tests.Entities/MangaInfos.cs index 6908b9f7..8e06fbcd 100644 --- a/Tests/Tests.Entities/MangaInfos.cs +++ b/Tests/Tests.Entities/MangaInfos.cs @@ -17,10 +17,10 @@ public static class Acomics public static class Henchan { - [InfoCache("https://h-chan.me/manga/12850-twisted-intent-chast-1.html", true)] + [InfoCache("https://henchan.pro/manga/12850-twisted-intent-chast-1.html", true)] public static MangaInfo TwistedIntent; - [InfoCache("https://h-chan.me/manga/14212-love-and-devil-glava-25.html", false)] + [InfoCache("https://henchan.pro/manga/14212-love-and-devil-glava-25.html", false)] public static MangaInfo LoveAndDevil; } diff --git a/Tests/Tests.Entities/Search/Henchan.cs b/Tests/Tests.Entities/Search/Henchan.cs index 2b950414..7cd220b2 100644 --- a/Tests/Tests.Entities/Search/Henchan.cs +++ b/Tests/Tests.Entities/Search/Henchan.cs @@ -13,7 +13,7 @@ public class Henchan : TestClass public void SearchOnHenchan() { var mangas = Search("Poolside"); - Assert.IsTrue(mangas.Any(m => m.Uri.OriginalString == "https://h-chan.me/manga/22839-shalosti-v-basseyne.html")); + Assert.IsTrue(mangas.Any(m => m.Uri.OriginalString == "https://henchan.pro/manga/22839-shalosti-v-basseyne.html")); var game = Search("A Tale of Two Swords "); Assert.IsEmpty(game); diff --git a/VersionInfo.cs b/VersionInfo.cs index 75f376ef..66d151ae 100644 --- a/VersionInfo.cs +++ b/VersionInfo.cs @@ -11,4 +11,4 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.49.7.54")] +[assembly: AssemblyVersion("1.49.8.59")]