Skip to content

Commit

Permalink
Merge pull request #344 from EhPanda-Team/develop
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
chihchy committed Sep 8, 2023
2 parents c49830b + 8ea5c8c commit 89f2280
Show file tree
Hide file tree
Showing 35 changed files with 1,393 additions and 1,030 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app
APP_VERSION: '2.7.1'
APP_VERSION: '2.7.2'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down
18 changes: 9 additions & 9 deletions EhPanda/App/Tools/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ struct Parser {
}
if gdt1Text.contains("File Size") {
infoPanel[4] = gdt2Text
.replacingOccurrences(of: " KB", with: "")
.replacingOccurrences(of: " MB", with: "")
.replacingOccurrences(of: " GB", with: "")
.replacingOccurrences(of: " KiB", with: "")
.replacingOccurrences(of: " MiB", with: "")
.replacingOccurrences(of: " GiB", with: "")

if gdt2Text.contains("KB") { infoPanel[5] = "KB" }
if gdt2Text.contains("MB") { infoPanel[5] = "MB" }
if gdt2Text.contains("GB") { infoPanel[5] = "GB" }
if gdt2Text.contains("KiB") { infoPanel[5] = "KiB" }
if gdt2Text.contains("MiB") { infoPanel[5] = "MiB" }
if gdt2Text.contains("GiB") { infoPanel[5] = "GiB" }
}
if gdt1Text.contains("Length") {
infoPanel[6] = gdt2Text.replacingOccurrences(of: " pages", with: "")
Expand Down Expand Up @@ -837,9 +837,9 @@ struct Parser {
break
}
} else {
if pText.contains("KB")
|| pText.contains("MB")
|| pText.contains("GB")
if pText.contains("KiB")
|| pText.contains("MiB")
|| pText.contains("GiB")
{
tmpFileSize = pText
} else {
Expand Down
28 changes: 22 additions & 6 deletions EhPanda/App/Tools/Utilities/URLUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,29 @@ private extension URL {
queryItems1[.fSrdd] = String(filter.minRating)
}

if filter.pageRangeActivated, let minPages = Int(filter.pageLowerBound),
let maxPages = Int(filter.pageUpperBound),
minPages > 0 && maxPages > 0 && minPages <= maxPages
{
if filter.pageRangeActivated {
queryItems2[.fSp] = .filterOn
queryItems1[.fSpf] = String(minPages)
queryItems1[.fSpt] = String(maxPages)

switch (Int(filter.pageLowerBound), Int(filter.pageUpperBound)) {
case let (.some(minPages), .some(maxPages)):
if minPages > 0 && maxPages > 0 && minPages <= maxPages {
queryItems1[.fSpf] = String(minPages)
queryItems1[.fSpt] = String(maxPages)
}

case let (.some(minPages), _):
if minPages > 0 {
queryItems1[.fSpf] = String(minPages)
}

case let (_, .some(maxPages)):
if maxPages > 0 {
queryItems1[.fSpt] = String(maxPages)
}

case (.none, .none):
break
}
}

if filter.disableLanguage { queryItems2[.fSfl] = .filterOn }
Expand Down
8 changes: 4 additions & 4 deletions EhPandaTests/Models/ListParserTestType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ extension ListParserTestType {
var assertCount: Int {
switch self {
case .frontPageMinimalList, .frontPageMinimalPlusList, .frontPageCompactList, .frontPageExtendedList, .frontPageThumbnailList:
return 200
return 100
case .watchedMinimalList, .watchedMinimalPlusList, .watchedCompactList, .watchedExtendedList, .watchedThumbnailList:
return 200
return 100
case .popularMinimalList, .popularMinimalPlusList, .popularCompactList, .popularExtendedList, .popularThumbnailList:
return 50
return 100
case .favoritesMinimalList, .favoritesMinimalPlusList, .favoritesCompactList, .favoritesExtendedList, .favoritesThumbnailList:
return 107
return 100
case .toplistsCompactList:
return 50
}
Expand Down
37 changes: 21 additions & 16 deletions EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions EhPandaTests/Resources/Parser/Gallery/GalleryMPVKeys.html

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions EhPandaTests/Resources/Parser/Gallery/GalleryNormalImageURL.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>(Suwako Land 5) [100yenMoFA (Mirino)] Suwa Nee-chan no Oose no Toori ni!! Suwa Shota Bangaihen 8 (Touhou Project)</title>
<link rel="stylesheet" type="text/css" href="https://e-hentai.org/z/0352/g.css" />
<title>◆FANBOX◆ AI Fetish [87052610&ai-fetish] [AI Generated]</title>
<link rel="stylesheet" type="text/css" href="https://e-hentai.org/z/0364/g.css" />
</head>
<body>
<script type="text/javascript">
Expand All @@ -11,6 +11,11 @@
return false;
}
</script>
<div id="i1" class="sni" style="width:1300px"><h1>(諏訪子ランド5) [100円外務省 (みりの)] すわ姉ちゃんのおおせのとおりに!! すわショタ番外編 8 (東方Project)</h1><div id="i2"><div class="sn"><a onclick="return load_image(1, '65610f3efb')" href="https://e-hentai.org/s/65610f3efb/1563022-1"><img src="https://ehgt.org/g/f.png" /></a><a id="prev" onclick="return load_image(1, '65610f3efb')" href="https://e-hentai.org/s/65610f3efb/1563022-1"><img src="https://ehgt.org/g/p.png" /></a><div><span>1</span> / <span>29</span></div><a id="next" onclick="return load_image(2, '0b24be0cc0')" href="https://e-hentai.org/s/0b24be0cc0/1563022-2"><img src="https://ehgt.org/g/n.png" /></a><a onclick="return load_image(29, '312cbad522')" href="https://e-hentai.org/s/312cbad522/1563022-29"><img src="https://ehgt.org/g/l.png" /></a></div><div>001.jpg :: 1280 x 1815 :: 361.3 KB</div></div><div id="i3"><a onclick="return load_image(2, '0b24be0cc0')" href="https://e-hentai.org/s/0b24be0cc0/1563022-2"><img id="img" src="https://wqyqeng.mqwmzmzefnoz.hath.network:30001/h/a25994ccb4606902e21e5a9328784bb78d419466-369972-1280-1815-jpg/keystamp=1644575400-5f4af872e1;fileindex=77053242;xres=1280/001.jpg" style="height:1815px;width:1280px" onerror="this.onerror=null; nl('30703-456826')" /></a></div><div id="i4"><div>001.jpg :: 1280 x 1815 :: 361.3 KB</div><div class="sn"><a onclick="return load_image(1, '65610f3efb')" href="https://e-hentai.org/s/65610f3efb/1563022-1"><img src="https://ehgt.org/g/f.png" /></a><a id="prev" onclick="return load_image(1, '65610f3efb')" href="https://e-hentai.org/s/65610f3efb/1563022-1"><img src="https://ehgt.org/g/p.png" /></a><div><span>1</span> / <span>29</span></div><a id="next" onclick="return load_image(2, '0b24be0cc0')" href="https://e-hentai.org/s/0b24be0cc0/1563022-2"><img src="https://ehgt.org/g/n.png" /></a><a onclick="return load_image(29, '312cbad522')" href="https://e-hentai.org/s/312cbad522/1563022-29"><img src="https://ehgt.org/g/l.png" /></a></div></div><div id="i5"><div class="sb"><a href="https://e-hentai.org/g/1563022/8d344a4494/"><img src="https://ehgt.org/g/b.png" referrerpolicy="no-referrer" /></a></div></div><div id="i6" class="if"> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="https://e-hentai.org/?f_shash=65610f3efb86a33dc2f7584db5f7aad711dddc2d&amp;fs_from=001.jpg+from+%28%E8%AB%8F%E8%A8%AA%E5%AD%90%E3%83%A9%E3%83%B3%E3%83%895%29+%5B100%E5%86%86%E5%A4%96%E5%8B%99%E7%9C%81+%28%E3%81%BF%E3%82%8A%E3%81%AE%29%5D+%E3%81%99%E3%82%8F%E5%A7%89%E3%81%A1%E3%82%83%E3%82%93%E3%81%AE%E3%81%8A%E3%81%8A%E3%81%9B%E3%81%AE%E3%81%A8%E3%81%8A%E3%82%8A%E3%81%AB%21%21+%E3%81%99%E3%82%8F%E3%82%B7%E3%83%A7%E3%82%BF%E7%95%AA%E5%A4%96%E7%B7%A8+8+%28%E6%9D%B1%E6%96%B9Project%29">Show all galleries with this file</a> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="#" onclick="prompt('Copy the URL below.', 'https://e-hentai.org/r/a25994ccb4606902e21e5a9328784bb78d419466-369972-1280-1815-jpg/forumtoken/1563022-1/001.jpg'); return false">Generate a static forum image link</a> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="#" id="loadfail" onclick="return nl('30703-456826')">Click here if the image fails loading</a> </div><div id="i7" class="if"> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="https://e-hentai.org/fullimg.php?gid=1563022&amp;page=1&amp;key=mjpgxpz9shm">Download original 2400 x 3403 1013.6 KB source</a></div></div><script type="text/javascript">var gid=1563022;var startpage=1;var startkey="65610f3efb";var showkey="h6vu6ew9shm";var base_url="https://e-hentai.org/";var api_url = "https://api.e-hentai.org/api.php";var prl=9999;var si="30703";var xres = 1280;var yres = 1815;</script><script type="text/javascript" src="https://e-hentai.org/z/0352/ehg_show.c.js"></script><div class="dp" style="margin:0 auto 5px"><a href="https://e-hentai.org/">Front Page</a> &nbsp; <a href="https://e-hentai.org/tos.php">Terms of Service</a> &nbsp; <a href="mailto:luke@juicyads.com">Advertise</a></div>
<div id="i1" class="sni" style="width:1300px"><h1>◆FANBOX◆ AI Fetish [87052610&ai-fetish] [AI Generated]</h1><div id="i2"><div class="sn"><a onclick="return load_image(1, '0000000000')" href="https://e-hentai.org/s/0000000000/0000000-1"><img src="https://ehgt.org/g/f.png" /></a><a id="prev" onclick="return load_image(1, '0000000000')" href="https://e-hentai.org/s/0000000000/0000000-1"><img src="https://ehgt.org/g/p.png" /></a><div><span>1</span> / <span>194</span></div><a id="next" onclick="return load_image(2, '000000000')" href="https://e-hentai.org/s/000000000/0000000-2"><img src="https://ehgt.org/g/n.png" /></a><a onclick="return load_image(194, '000000000')" href="https://e-hentai.org/s/000000000/0000000-194"><img src="https://ehgt.org/g/l.png" /></a></div><div>87052610_5090394_0.jpg :: 1280 x 1920 :: 304.2 KiB</div></div><div id="i3"><a onclick="return load_image(2, '000000000')" href="https://e-hentai.org/s/000000000/0000000-2"><img id="img" src="https://akrtazd.spuqplybaxmf.hath.network:65000/h/ea42b28bceeae68f1f6adb414da61d186b3d126b-311480-1280-1920-jpg/keystamp=1694132700-fd778f8260;fileindex=132044713;xres=1280/87052610_5090394_0.jpg" style="height:1920px;width:1280px" onerror="this.onerror=null; nl('00000-000000')" /></a></div><div id="i4"><div>87052610_5090394_0.jpg :: 1280 x 1920 :: 304.2 KiB</div><div class="sn"><a onclick="return load_image(1, '0000000000')" href="https://e-hentai.org/s/0000000000/0000000-1"><img src="https://ehgt.org/g/f.png" /></a><a id="prev" onclick="return load_image(1, '0000000000')" href="https://e-hentai.org/s/0000000000/0000000-1"><img src="https://ehgt.org/g/p.png" /></a><div><span>1</span> / <span>194</span></div><a id="next" onclick="return load_image(2, '000000000')" href="https://e-hentai.org/s/000000000/0000000-2"><img src="https://ehgt.org/g/n.png" /></a><a onclick="return load_image(194, '000000000')" href="https://e-hentai.org/s/000000000/0000000-194"><img src="https://ehgt.org/g/l.png" /></a></div></div><div id="i5"><div class="sb"><a href="https://e-hentai.org/g/0000000/898683e1d1/"><img src="https://ehgt.org/g/b.png" referrerpolicy="no-referrer" /></a></div></div><div id="i6" class="if"> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="https://e-hentai.org/?f_shash=0000000000f5cae13e9b5f9a1086b41600c9ce7e&amp;fs_from=87052610_5090394_0.jpg+from+%E2%97%86FANBOX%E2%97%86+AI+Fetish+%5B87052610%EF%BC%86ai-fetish%5D+%5BAI+Generated%5D">Show all galleries with this file</a> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="#" onclick="prompt('Copy the URL below.', 'https://e-hentai.org/r/ea42b28bceeae68f1f6adb414da61d186b3d126b-311480-1280-1920-jpg/forumtoken/0000000-1/87052610_5090394_0.jpg'); return false">Generate a static forum image link</a> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="#" id="loadfail" onclick="return nl('00000-000000')">Click here if the image fails loading</a> </div><div id="i7" class="if"> &nbsp; <img src="https://ehgt.org/g/mr.gif" class="mr" /> <a href="https://e-hentai.org/fullimg.php?gid=0000000&amp;page=1&amp;key=000000000">Download original 2048 x 3072 6.13 MiB source</a></div></div><script type="text/javascript">var gid=0000000;var startpage=1;var startkey="0000000000";var showkey="0000000000";var base_url="https://e-hentai.org/";var api_url = "https://api.e-hentai.org/api.php";var prl=9999;var si="35523";var xres = 1280;var yres = 1920;</script><script type="text/javascript" src="https://e-hentai.org/z/0364/ehg_show.c.js"></script>
<div class="dp" style="margin:0 auto 5px">
<a href="https://e-hentai.org/">Front Page</a>
&nbsp; <a href="https://e-hentai.org/tos.php">Terms of Service</a> &nbsp; <a href="mailto:luke@juicyads.com">Advertise</a>

</div>
</body>
</html>
191 changes: 98 additions & 93 deletions EhPandaTests/Resources/Parser/List/FavoritesCompactList.html

Large diffs are not rendered by default.

191 changes: 98 additions & 93 deletions EhPandaTests/Resources/Parser/List/FavoritesExtendedList.html

Large diffs are not rendered by default.

191 changes: 98 additions & 93 deletions EhPandaTests/Resources/Parser/List/FavoritesMinimalList.html

Large diffs are not rendered by default.

191 changes: 98 additions & 93 deletions EhPandaTests/Resources/Parser/List/FavoritesMinimalPlusList.html

Large diffs are not rendered by default.

191 changes: 98 additions & 93 deletions EhPandaTests/Resources/Parser/List/FavoritesThumbnailList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/FrontPageCompactList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/FrontPageExtendedList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/FrontPageMinimalList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/FrontPageMinimalPlusList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/FrontPageThumbnailList.html

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions EhPandaTests/Resources/Parser/List/PopularCompactList.html

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions EhPandaTests/Resources/Parser/List/PopularExtendedList.html

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions EhPandaTests/Resources/Parser/List/PopularMinimalList.html

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions EhPandaTests/Resources/Parser/List/PopularMinimalPlusList.html

Large diffs are not rendered by default.

34 changes: 27 additions & 7 deletions EhPandaTests/Resources/Parser/List/PopularThumbnailList.html

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions EhPandaTests/Resources/Parser/List/ToplistsCompactList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/WatchedCompactList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/WatchedExtendedList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/WatchedMinimalList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/WatchedMinimalPlusList.html

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions EhPandaTests/Resources/Parser/List/WatchedThumbnailList.html

Large diffs are not rendered by default.

Loading

0 comments on commit 89f2280

Please sign in to comment.