Skip to content

Commit

Permalink
Fix bug on grouple sites parsing and release 1.51.8.38
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkAlex committed Oct 26, 2022
1 parent bd530fc commit 44bb5fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# История версий
***
## 1.51.8.38 — 2022-10-27

### Исправлено
* Доработки на https://readmanga.live/, https://mintmanga.live для глав с дробной нумерацией

***
## 1.51.7.37 — 2022-10-26

Expand Down
5 changes: 3 additions & 2 deletions Sites/Grouple.ru/GroupleChapter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using System.Text.RegularExpressions;

namespace Grouple
Expand Down Expand Up @@ -28,7 +29,7 @@ public GroupleChapter(Uri uri, string name)
: base(uri, name)
{
this.VolumeNumber = Convert.ToInt32(Regex.Match(uri.ToString(), @"vol[-]?[0-9]+").Value.Remove(0, 3));
this.Number = Convert.ToInt32(Regex.Match(uri.ToString(), @"/[-]?[0-9]+", RegexOptions.RightToLeft).Value.Remove(0, 1));
this.Number = double.Parse(Regex.Match(uri.ToString(), @"/[-]?[0-9.]+", RegexOptions.RightToLeft).Value.Remove(0, 1), CultureInfo.InvariantCulture);
}

protected GroupleChapter()
Expand All @@ -39,4 +40,4 @@ protected GroupleChapter()
#endregion

}
}
}
2 changes: 1 addition & 1 deletion Sites/Grouple.ru/GroupleParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public override async Task UpdateContent(IManga manga)
document.LoadHtml(page.Content);
hasCopyrightNotice = Copyrights.Any(c => document.DocumentNode.InnerText.Contains(c));
var linkNodes = document.DocumentNode
.SelectNodes("//div[@class=\"expandable chapters-link\"]//a[@href]")
.SelectNodes("//div[@class=\"expandable chapters-link\"]//a[contains(@class, 'chapter-link')]")
.Reverse()
.ToList();
links = linkNodes
Expand Down
10 changes: 10 additions & 0 deletions Tests/Tests.Entities/Manga/ReadmangaStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ public async Task AddEmptyReadmanga()
Assert.AreEqual(0, chapters);
}

[Test]
public async Task AddReadmangaWithFractionNumber()
{
var manga = await Mangas.Create(new Uri($"{Grouple.Constants.ReadmangaHost}vanpanchmen")).ConfigureAwait(false);
await new ReadmangaParser().UpdateContent(manga).ConfigureAwait(false);

var chapters = manga.Volumes.SelectMany(v => v.Container);
Assert.IsTrue(chapters.Any(c => c.Number == 209.2));
}

[Test]
public async Task AddSingleReadmanga()
{
Expand Down
2 changes: 1 addition & 1 deletion VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.51.7.37")]
[assembly: AssemblyVersion("1.51.8.38")]

0 comments on commit 44bb5fc

Please sign in to comment.