Skip to content

Commit

Permalink
Fix Issue#40: update member parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandaka committed Mar 17, 2017
1 parent c855990 commit d87f582
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion NijieDownloader.Library/Model/NijieMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static string GenerateMemberUrl(int memberId, MemberMode mode, int page)
switch (mode)
{
case MemberMode.Images:
prefix = "//nijie.info/members_illust.php?id=";
prefix = "//nijie.info/members_illust.php?p=" + page + "&id=";
break;

case MemberMode.Doujin:
Expand Down
13 changes: 10 additions & 3 deletions NijieDownloader.Library/Nijie.Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ private void ParseMemberBookmark(HtmlDocument doc, NijieMember member)

item.Remove();
}
CheckNextPageAvailable(doc, member);

var imageCountElements = doc.DocumentNode.SelectNodes("//p[@class='mem-indent float-left']/em");
member.TotalImages = ParseTotalImageCount(imageCountElements);
}

private static void CheckNextPageAvailable(HtmlDocument doc, NijieMember member)
{

// check next page
member.IsNextAvailable = false;
Expand All @@ -246,9 +254,6 @@ private void ParseMemberBookmark(HtmlDocument doc, NijieMember member)
}
}
}

var imageCountElements = doc.DocumentNode.SelectNodes("//p[@class='mem-indent float-left']/em");
member.TotalImages = ParseTotalImageCount(imageCountElements);
}

private void ParseMemberImages(HtmlDocument doc, NijieMember member)
Expand All @@ -269,6 +274,8 @@ private void ParseMemberImages(HtmlDocument doc, NijieMember member)
image.Member = member;
}

CheckNextPageAvailable(doc, member);

var imageCountElements = doc.DocumentNode.SelectNodes("//p[@class='mem-indent float-left']/em");
member.TotalImages = ParseTotalImageCount(imageCountElements);
}
Expand Down
4 changes: 2 additions & 2 deletions NijieDownloader.Library/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.7.8")]
[assembly: AssemblyFileVersion("1.0.7.8")]
[assembly: AssemblyVersion("1.0.7.9")]
[assembly: AssemblyFileVersion("1.0.7.9")]
6 changes: 2 additions & 4 deletions NijieDownloader.UI/JobRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ private void SaveImageToDB(JobDownloadViewModel job, NijieImage image)
/// <param name="filename"></param>
private int downloadUrl(JobDownloadViewModel job, string url, string referer, string filename)
{

filename = Util.SanitizeFilename(filename);
url = Util.FixUrl(url, Nijie.ROOT_DOMAIN);

Expand All @@ -535,10 +536,7 @@ private int downloadUrl(JobDownloadViewModel job, string url, string referer, st
try
{
job.Message = "Saving to: " + filename;
MainWindow.Bot.Download(url, referer, filename, x =>
{
job.Message = x;
}, job.CancelToken);
MainWindow.Bot.Download(url, referer, filename, x => { job.Message = x; }, job.CancelToken);
}
catch (NijieException nex)
{
Expand Down
4 changes: 2 additions & 2 deletions NijieDownloader.UI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.7.8")]
[assembly: AssemblyFileVersion("1.0.7.8")]
[assembly: AssemblyVersion("1.0.7.9")]
[assembly: AssemblyFileVersion("1.0.7.9")]
13 changes: 8 additions & 5 deletions NijieDownloader.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NijieDownloader.Library", "NijieDownloader.Library\NijieDownloader.Library.csproj", "{6976B954-CD09-4FE6-9880-BF45150A6EF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nandaka.Common", "Nandaka.Common\Nandaka.Common.csproj", "{679DC8EF-673E-40CC-8478-08B3CD4BA836}"
Expand All @@ -17,9 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NijieDownloader.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Expand Down Expand Up @@ -55,6 +54,7 @@ Global
{91A2504C-9646-4906-BCE9-633253120D8C}.Debug|x86.ActiveCfg = Debug|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Debug|x86.Build.0 = Debug|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Release|Any CPU.ActiveCfg = Release|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Release|Any CPU.Build.0 = Release|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Release|Mixed Platforms.ActiveCfg = Release|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Release|Mixed Platforms.Build.0 = Release|x86
{91A2504C-9646-4906-BCE9-633253120D8C}.Release|x86.ActiveCfg = Release|x86
Expand All @@ -73,4 +73,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = NijieDownloader.vsmdi
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Nijie Downloader 1.0.7.9
- Fix Issue#40: update member parser.

Nijie Downloader 1.0.7.8
- Update member parser.
- Implement #38 and #39: update 404 handler.
Expand Down

0 comments on commit d87f582

Please sign in to comment.