Skip to content

Commit

Permalink
Merge pull request #293 from EhPanda-Team/develop
Browse files Browse the repository at this point in the history
Features & Bugfixes
  • Loading branch information
chihchy committed Nov 17, 2022
2 parents 4fff829 + 3bd322c commit 72f792a
Show file tree
Hide file tree
Showing 27 changed files with 815 additions and 414 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.1.app
APP_VERSION: '2.4.5'
APP_VERSION: '2.5.0'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down
20 changes: 20 additions & 0 deletions EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@
AB86AC1327856F2700E61E6A /* AppLockStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB86AC1227856F2700E61E6A /* AppLockStore.swift */; };
AB86AC1A2785C2B300E61E6A /* HomeStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB86AC192785C2B300E61E6A /* HomeStore.swift */; };
AB8C821926BF801700E8C5E6 /* EhSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB8C821826BF801700E8C5E6 /* EhSetting.swift */; };
AB90276B291F548700697256 /* AppIcon_NotMyPresident@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB902766291F548600697256 /* AppIcon_NotMyPresident@3x.png */; };
AB90276C291F548700697256 /* AppIcon_NotMyPresident_iPad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB902767291F548600697256 /* AppIcon_NotMyPresident_iPad@2x.png */; };
AB90276D291F548700697256 /* AppIcon_NotMyPresident_iPad_Pro@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB902768291F548700697256 /* AppIcon_NotMyPresident_iPad_Pro@2x.png */; };
AB90276E291F548700697256 /* AppIcon_NotMyPresident_iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = AB902769291F548700697256 /* AppIcon_NotMyPresident_iPad.png */; };
AB90276F291F548700697256 /* AppIcon_NotMyPresident@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB90276A291F548700697256 /* AppIcon_NotMyPresident@2x.png */; };
ABA12F3227D49CEB0021922D /* AccountSettingStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA12F3127D49CEB0021922D /* AccountSettingStoreTests.swift */; };
ABA732D925A8018A00B3D9AB /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732D825A8018A00B3D9AB /* Extensions.swift */; };
ABA732DF25A852D800B3D9AB /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732DE25A852D800B3D9AB /* Filter.swift */; };
Expand Down Expand Up @@ -473,6 +478,11 @@
AB86AC1227856F2700E61E6A /* AppLockStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockStore.swift; sourceTree = "<group>"; };
AB86AC192785C2B300E61E6A /* HomeStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeStore.swift; sourceTree = "<group>"; };
AB8C821826BF801700E8C5E6 /* EhSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhSetting.swift; sourceTree = "<group>"; };
AB902766291F548600697256 /* AppIcon_NotMyPresident@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon_NotMyPresident@3x.png"; sourceTree = "<group>"; };
AB902767291F548600697256 /* AppIcon_NotMyPresident_iPad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon_NotMyPresident_iPad@2x.png"; sourceTree = "<group>"; };
AB902768291F548700697256 /* AppIcon_NotMyPresident_iPad_Pro@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon_NotMyPresident_iPad_Pro@2x.png"; sourceTree = "<group>"; };
AB902769291F548700697256 /* AppIcon_NotMyPresident_iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon_NotMyPresident_iPad.png; sourceTree = "<group>"; };
AB90276A291F548700697256 /* AppIcon_NotMyPresident@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon_NotMyPresident@2x.png"; sourceTree = "<group>"; };
AB994DBB25986F7A00E9A367 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
ABA12F3127D49CEB0021922D /* AccountSettingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSettingStoreTests.swift; sourceTree = "<group>"; };
ABA732D825A8018A00B3D9AB /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -884,6 +894,11 @@
AB0CFB8527BBD2D7004BD372 /* AppIcon_Developer_iPad.png */,
AB0CFB8327BBD2D7004BD372 /* AppIcon_Developer_iPad@2x.png */,
AB0CFB8427BBD2D7004BD372 /* AppIcon_Developer@2x.png */,
AB902768291F548700697256 /* AppIcon_NotMyPresident_iPad_Pro@2x.png */,
AB902769291F548700697256 /* AppIcon_NotMyPresident_iPad.png */,
AB902767291F548600697256 /* AppIcon_NotMyPresident_iPad@2x.png */,
AB90276A291F548700697256 /* AppIcon_NotMyPresident@2x.png */,
AB902766291F548600697256 /* AppIcon_NotMyPresident@3x.png */,
ABE9012027F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad_Pro@2x.png */,
ABE9011E27F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png */,
ABE9012127F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad@2x.png */,
Expand Down Expand Up @@ -1512,20 +1527,25 @@
files = (
AB0CFB8C27BBD2D7004BD372 /* AppIcon_Developer@3x.png in Resources */,
AB0CFB9627BBD323004BD372 /* AppIcon_Ukiyoe@2x.png in Resources */,
AB90276E291F548700697256 /* AppIcon_NotMyPresident_iPad.png in Resources */,
AB90276D291F548700697256 /* AppIcon_NotMyPresident_iPad_Pro@2x.png in Resources */,
AB0CFB7A27BAB9D0004BD372 /* AppIcon_Default@2x.png in Resources */,
AB0CFB7527BAB9D0004BD372 /* AppIcon_Default_iPad@2x.png in Resources */,
AB0CFB9227BBD323004BD372 /* AppIcon_Ukiyoe_iPad@2x.png in Resources */,
ABC3C7852593699B00E0C11B /* Assets.xcassets in Resources */,
AB0CFB7B27BAB9D0004BD372 /* AppIcon_Default_iPad.png in Resources */,
AB90276C291F548700697256 /* AppIcon_NotMyPresident_iPad@2x.png in Resources */,
AB0CFB9527BBD323004BD372 /* AppIcon_Ukiyoe_iPad.png in Resources */,
ABE9012427F722D100F3651D /* AppIcon_StandWithUkraine2022@3x.png in Resources */,
AB90276B291F548700697256 /* AppIcon_NotMyPresident@3x.png in Resources */,
AB0CFB8827BBD2D7004BD372 /* AppIcon_Developer_iPad@2x.png in Resources */,
ABE9012227F722D100F3651D /* AppIcon_StandWithUkraine2022@2x.png in Resources */,
AB0CFB7427BAB9D0004BD372 /* AppIcon_Default@3x.png in Resources */,
AB7E6B3025D24FE00035CC68 /* InfoPlist.strings in Resources */,
AB0CFB9327BBD323004BD372 /* AppIcon_Ukiyoe@3x.png in Resources */,
AB0CFB8927BBD2D7004BD372 /* AppIcon_Developer@2x.png in Resources */,
ABEE0AFA2595C6F800C997AE /* Localizable.strings in Resources */,
AB90276F291F548700697256 /* AppIcon_NotMyPresident@2x.png in Resources */,
ABD5FDD4263D05110021A4C6 /* .swiftlint.yml in Resources */,
AB26F59B27AD125A00AB3468 /* Constant.strings in Resources */,
ABE9012527F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad_Pro@2x.png in Resources */,
Expand Down
Binary file added EhPanda/App/Icons/AppIcon_NotMyPresident@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/AppIcon_NotMyPresident@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/AppIcon_NotMyPresident_iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions EhPanda/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
<string>AppIcon_StandWithUkraine2022</string>
</array>
</dict>
<key>AppIcon_NotMyPresident</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_NotMyPresident</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
Expand Down Expand Up @@ -85,6 +92,14 @@
<string>AppIcon_StandWithUkraine2022_iPad_Pro</string>
</array>
</dict>
<key>AppIcon_NotMyPresident</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_NotMyPresident_iPad</string>
<string>AppIcon_NotMyPresident_iPad_Pro</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
Expand Down
16 changes: 8 additions & 8 deletions EhPanda/App/Tools/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ struct Defaults {
static let login = forum.appending(queryItems: [.act: .loginAct, .code: .zeroOne])
static let webLogin = forum.appending(queryItems: [.act: .loginAct])

static let api = host.appendingPathComponent("api.php")
static let myTags = host.appendingPathComponent("mytags")
static var api: Foundation.URL { host.appendingPathComponent("api.php") }
static var myTags: Foundation.URL { host.appendingPathComponent("mytags") }
static let news = ehentai.appendingPathComponent("news.php")
static let uConfig = host.appendingPathComponent("uconfig.php")
static let galleryPopups = host.appendingPathComponent("gallerypopups.php")
static let galleryTorrents = host.appendingPathComponent("gallerytorrents.php")
static var uConfig: Foundation.URL { host.appendingPathComponent("uconfig.php") }
static var galleryPopups: Foundation.URL { host.appendingPathComponent("gallerypopups.php") }
static var galleryTorrents: Foundation.URL { host.appendingPathComponent("gallerytorrents.php") }

static let popular = host.appendingPathComponent("popular")
static let watched = host.appendingPathComponent("watched")
static var popular: Foundation.URL { host.appendingPathComponent("popular") }
static var watched: Foundation.URL { host.appendingPathComponent("watched") }
static let toplist = ehentai.appendingPathComponent("toplist.php")
static let favorites = host.appendingPathComponent("favorites.php")
static var favorites: Foundation.URL { host.appendingPathComponent("favorites.php") }

// GitHub
static let github: Foundation.URL = .init(string: "https://github.com/").forceUnwrapped
Expand Down
19 changes: 16 additions & 3 deletions EhPanda/App/Tools/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ extension Parser {
let form = tmpForm else { throw AppError.parseFailed }

// swiftlint:disable line_length
var ehProfiles = [EhProfile](); var isCapableOfCreatingNewProfile: Bool?; var capableLoadThroughHathSetting: EhSetting.LoadThroughHathSetting?; var capableImageResolution: EhSetting.ImageResolution?; var capableSearchResultCount: EhSetting.SearchResultCount?; var capableThumbnailConfigSize: EhSetting.ThumbnailSize?; var capableThumbnailConfigRowCount: EhSetting.ThumbnailRowCount?; var loadThroughHathSetting: EhSetting.LoadThroughHathSetting?; var browsingCountry: EhSetting.BrowsingCountry?; var imageResolution: EhSetting.ImageResolution?; var imageSizeWidth: Float?; var imageSizeHeight: Float?; var galleryName: EhSetting.GalleryName?; var literalBrowsingCountry: String?; var archiverBehavior: EhSetting.ArchiverBehavior?; var displayMode: EhSetting.DisplayMode?; var disabledCategories = [Bool](); var favoriteCategories = [String](); var favoritesSortOrder: EhSetting.FavoritesSortOrder?; var ratingsColor: String?; var excludedNamespaces = [Bool](); var tagFilteringThreshold: Float?; var tagWatchingThreshold: Float?; var excludedLanguages = [Bool](); var excludedUploaders: String?; var searchResultCount: EhSetting.SearchResultCount?; var thumbnailLoadTiming: EhSetting.ThumbnailLoadTiming?; var thumbnailConfigSize: EhSetting.ThumbnailSize?; var thumbnailConfigRows: EhSetting.ThumbnailRowCount?; var thumbnailScaleFactor: Float?; var viewportVirtualWidth: Float?; var commentsSortOrder: EhSetting.CommentsSortOrder?; var commentVotesShowTiming: EhSetting.CommentVotesShowTiming?; var tagsSortOrder: EhSetting.TagsSortOrder?; var galleryShowPageNumbers: Bool?; var useOriginalImages: Bool?; var useMultiplePageViewer: Bool?; var multiplePageViewerStyle: EhSetting.MultiplePageViewerStyle?; var multiplePageViewerShowThumbnailPane: Bool?
var ehProfiles = [EhProfile](); var isCapableOfCreatingNewProfile: Bool?; var capableLoadThroughHathSetting: EhSetting.LoadThroughHathSetting?; var capableImageResolution: EhSetting.ImageResolution?; var capableSearchResultCount: EhSetting.SearchResultCount?; var capableThumbnailConfigSize: EhSetting.ThumbnailSize?; var capableThumbnailConfigRowCount: EhSetting.ThumbnailRowCount?; var loadThroughHathSetting: EhSetting.LoadThroughHathSetting?; var browsingCountry: EhSetting.BrowsingCountry?; var imageResolution: EhSetting.ImageResolution?; var imageSizeWidth: Float?; var imageSizeHeight: Float?; var galleryName: EhSetting.GalleryName?; var literalBrowsingCountry: String?; var archiverBehavior: EhSetting.ArchiverBehavior?; var displayMode: EhSetting.DisplayMode?; var disabledCategories = [Bool](); var favoriteCategories = [String](); var favoritesSortOrder: EhSetting.FavoritesSortOrder?; var ratingsColor: String?; var excludedNamespaces = [Bool](); var tagFilteringThreshold: Float?; var tagWatchingThreshold: Float?; var showFilteredRemovalCount: Bool?; var excludedLanguages = [Bool](); var excludedUploaders: String?; var searchResultCount: EhSetting.SearchResultCount?; var thumbnailLoadTiming: EhSetting.ThumbnailLoadTiming?; var thumbnailConfigSize: EhSetting.ThumbnailSize?; var thumbnailConfigRows: EhSetting.ThumbnailRowCount?; var thumbnailScaleFactor: Float?; var viewportVirtualWidth: Float?; var commentsSortOrder: EhSetting.CommentsSortOrder?; var commentVotesShowTiming: EhSetting.CommentVotesShowTiming?; var tagsSortOrder: EhSetting.TagsSortOrder?; var galleryShowPageNumbers: Bool?; var useOriginalImages: Bool?; var useMultiplePageViewer: Bool?; var multiplePageViewerStyle: EhSetting.MultiplePageViewerStyle?; var multiplePageViewerShowThumbnailPane: Bool?
// swiftlint:enable line_length

ehProfiles = parseSelections(node: profileOuter, name: "profile_set")
Expand Down Expand Up @@ -1193,6 +1193,9 @@ extension Parser {
tagWatchingThreshold = Float(parseString(node: optouter, name: "wt") ?? "0")
if tagWatchingThreshold == nil { tagWatchingThreshold = 0 }
}
if optouter.at_xpath("//input [@name='tf']") != nil {
showFilteredRemovalCount = parseInt(node: optouter, name: "tf") == 0
}
if optouter.at_xpath("//div [@id='xlasel']") != nil {
excludedLanguages = Array(0...49)
.map { "xl_\(EhSetting.languageValues[$0])" }
Expand Down Expand Up @@ -1254,7 +1257,7 @@ extension Parser {
guard !ehProfiles.filter(\.isSelected).isEmpty, let isCapableOfCreatingNewProfile, let capableLoadThroughHathSetting, let capableImageResolution, let capableSearchResultCount, let capableThumbnailConfigSize, let capableThumbnailConfigRowCount, let loadThroughHathSetting, let browsingCountry, let literalBrowsingCountry, let imageResolution, let imageSizeWidth, let imageSizeHeight, let galleryName, let archiverBehavior, let displayMode, disabledCategories.count == 10, favoriteCategories.count == 10, let favoritesSortOrder, let ratingsColor, excludedNamespaces.count == 11, let tagFilteringThreshold, let tagWatchingThreshold, excludedLanguages.count == 50, let excludedUploaders, let searchResultCount, let thumbnailLoadTiming, let thumbnailConfigSize, let thumbnailConfigRows, let thumbnailScaleFactor, let viewportVirtualWidth, let commentsSortOrder, let commentVotesShowTiming, let tagsSortOrder, let galleryShowPageNumbers
else { throw AppError.parseFailed }

return EhSetting(ehProfiles: ehProfiles.sorted(), isCapableOfCreatingNewProfile: isCapableOfCreatingNewProfile, capableLoadThroughHathSetting: capableLoadThroughHathSetting, capableImageResolution: capableImageResolution, capableSearchResultCount: capableSearchResultCount, capableThumbnailConfigSize: capableThumbnailConfigSize, capableThumbnailConfigRowCount: capableThumbnailConfigRowCount, loadThroughHathSetting: loadThroughHathSetting, browsingCountry: browsingCountry, literalBrowsingCountry: literalBrowsingCountry, imageResolution: imageResolution, imageSizeWidth: imageSizeWidth, imageSizeHeight: imageSizeHeight, galleryName: galleryName, archiverBehavior: archiverBehavior, displayMode: displayMode, disabledCategories: disabledCategories, favoriteCategories: favoriteCategories, favoritesSortOrder: favoritesSortOrder, ratingsColor: ratingsColor, excludedNamespaces: excludedNamespaces, tagFilteringThreshold: tagFilteringThreshold, tagWatchingThreshold: tagWatchingThreshold, excludedLanguages: excludedLanguages, excludedUploaders: excludedUploaders, searchResultCount: searchResultCount, thumbnailLoadTiming: thumbnailLoadTiming, thumbnailConfigSize: thumbnailConfigSize, thumbnailConfigRows: thumbnailConfigRows, thumbnailScaleFactor: thumbnailScaleFactor, viewportVirtualWidth: viewportVirtualWidth, commentsSortOrder: commentsSortOrder, commentVotesShowTiming: commentVotesShowTiming, tagsSortOrder: tagsSortOrder, galleryShowPageNumbers: galleryShowPageNumbers, useOriginalImages: useOriginalImages, useMultiplePageViewer: useMultiplePageViewer, multiplePageViewerStyle: multiplePageViewerStyle, multiplePageViewerShowThumbnailPane: multiplePageViewerShowThumbnailPane
return EhSetting(ehProfiles: ehProfiles.sorted(), isCapableOfCreatingNewProfile: isCapableOfCreatingNewProfile, capableLoadThroughHathSetting: capableLoadThroughHathSetting, capableImageResolution: capableImageResolution, capableSearchResultCount: capableSearchResultCount, capableThumbnailConfigSize: capableThumbnailConfigSize, capableThumbnailConfigRowCount: capableThumbnailConfigRowCount, loadThroughHathSetting: loadThroughHathSetting, browsingCountry: browsingCountry, literalBrowsingCountry: literalBrowsingCountry, imageResolution: imageResolution, imageSizeWidth: imageSizeWidth, imageSizeHeight: imageSizeHeight, galleryName: galleryName, archiverBehavior: archiverBehavior, displayMode: displayMode, disabledCategories: disabledCategories, favoriteCategories: favoriteCategories, favoritesSortOrder: favoritesSortOrder, ratingsColor: ratingsColor, excludedNamespaces: excludedNamespaces, tagFilteringThreshold: tagFilteringThreshold, tagWatchingThreshold: tagWatchingThreshold, showFilteredRemovalCount: showFilteredRemovalCount, excludedLanguages: excludedLanguages, excludedUploaders: excludedUploaders, searchResultCount: searchResultCount, thumbnailLoadTiming: thumbnailLoadTiming, thumbnailConfigSize: thumbnailConfigSize, thumbnailConfigRows: thumbnailConfigRows, thumbnailScaleFactor: thumbnailScaleFactor, viewportVirtualWidth: viewportVirtualWidth, commentsSortOrder: commentsSortOrder, commentVotesShowTiming: commentVotesShowTiming, tagsSortOrder: tagsSortOrder, galleryShowPageNumbers: galleryShowPageNumbers, useOriginalImages: useOriginalImages, useMultiplePageViewer: useMultiplePageViewer, multiplePageViewerStyle: multiplePageViewerStyle, multiplePageViewerShowThumbnailPane: multiplePageViewerShowThumbnailPane
)
// swiftlint:enable line_length
}
Expand Down Expand Up @@ -1343,14 +1346,24 @@ extension Parser {
let currentStr = link.at_xpath("//td [@class='ptds']")?.text
else {
if let link = doc.at_xpath("//div [@class='searchnav']") {
var timestamp: String?
var isEnabled = false

for aLink in link.xpath("//a") where aLink.text?.contains("Next") == true {
timestamp = aLink["href"]
.map(URLComponents.init)??
.queryItems?
.first(where: { $0.name == "next" })?
.value?
.split(separator: "-")
.last
.map(String.init)

isEnabled = true
break
}

return PageNumber(isNextButtonEnabled: isEnabled)
return PageNumber(lastItemTimestamp: timestamp, isNextButtonEnabled: isEnabled)
} else {
return PageNumber(isNextButtonEnabled: false)
}
Expand Down
Loading

0 comments on commit 72f792a

Please sign in to comment.