diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 0b38e16a..1f35e33d 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -8,7 +8,7 @@ permissions: pull-requests: write jobs: dependencies: - runs-on: macos-14 + runs-on: macos-15 steps: - uses: actions/checkout@v4 with: @@ -19,10 +19,10 @@ jobs: with: forceResolution: true failWhenOutdated: false - xcodePath: '/Applications/Xcode_15.4.app' + xcodePath: '/Applications/Xcode_16.0.app' - name: Create Pull Request if: steps.resolution.outputs.dependenciesChanged == 'true' - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: branch: 'update-dependencies' delete-branch: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e51092ea..690497a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,8 +5,8 @@ on: - main types: [closed] env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app - APP_VERSION: '2.7.5' + DEVELOPER_DIR: /Applications/Xcode_16.0.app + APP_VERSION: '2.7.6' SCHEME_NAME: 'EhPanda' ALTSTORE_JSON_PATH: './AltStore.json' BUILDS_PATH: '/tmp/action-builds' @@ -19,7 +19,7 @@ env: jobs: Deploy: - runs-on: macos-14 + runs-on: macos-15 if: github.event.pull_request.merged == true && github.event.pull_request.user.login == 'chihchy' steps: - name: Checkout @@ -34,7 +34,7 @@ jobs: run: xcodebuild clean test -skipMacroValidation -scheme ${{ env.SCHEME_NAME }} - -destination 'platform=iOS Simulator,name=iPhone 15 Pro' + -destination 'platform=iOS Simulator,name=iPhone 16 Pro' - name: Bump version id: bump-version uses: yanamura/ios-bump-version@v1 @@ -77,7 +77,7 @@ jobs: [[ ! -z "${{ steps.bump-version.outputs.version }}" ]] || exit 1 [[ ! -z "${{ steps.retrieve-data.outputs.version_date }}" ]] || exit 1 - name: Release to GitHub - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true files: ${{ env.IPA_OUTPUT_PATH }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ee38c01..8f2213b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,10 +2,10 @@ name: Test on: [push, workflow_dispatch] env: SCHEME_NAME: 'EhPanda' - DEVELOPER_DIR: /Applications/Xcode_15.4.app + DEVELOPER_DIR: /Applications/Xcode_16.0.app jobs: Test: - runs-on: macos-14 + runs-on: macos-15 if: ${{ !contains(github.event.head_commit.message, '[skip test]') }} steps: - name: Checkout @@ -16,4 +16,4 @@ jobs: run: xcodebuild clean test -skipMacroValidation -scheme ${{ env.SCHEME_NAME }} - -destination 'platform=iOS Simulator,name=iPhone 15 Pro' + -destination 'platform=iOS Simulator,name=iPhone 16 Pro' diff --git a/EhPanda/App/Generated/Strings.swift b/EhPanda/App/Generated/Strings.swift index d72d0fdb..83049af2 100644 --- a/EhPanda/App/Generated/Strings.swift +++ b/EhPanda/App/Generated/Strings.swift @@ -94,10 +94,10 @@ internal enum L10n { internal static let chihchy = L10n.tr("Constant", "app.code_level_contributor.link.chihchy", fallback: "https://github.com/chihchy") /// https://github.com/Jimmy-Prime internal static let jimmyPrime = L10n.tr("Constant", "app.code_level_contributor.link.Jimmy-Prime", fallback: "https://github.com/Jimmy-Prime") - /// https://github.com/remlostime - internal static let remlostime = L10n.tr("Constant", "app.code_level_contributor.link.remlostime", fallback: "https://github.com/remlostime") /// https://github.com/tatsuz0u internal static let tatsuz0u = L10n.tr("Constant", "app.code_level_contributor.link.tatsuz0u", fallback: "https://github.com/tatsuz0u") + /// https://github.com/vvbbnn00 + internal static let vvbbnn00 = L10n.tr("Constant", "app.code_level_contributor.link.vvbbnn00", fallback: "https://github.com/vvbbnn00") /// https://github.com/xioxin internal static let xioxin = L10n.tr("Constant", "app.code_level_contributor.link.xioxin", fallback: "https://github.com/xioxin") } @@ -106,10 +106,10 @@ internal enum L10n { internal static let chihchy = L10n.tr("Constant", "app.code_level_contributor.text.chihchy", fallback: "Chihchy") /// Jimmy Prime internal static let jimmyPrime = L10n.tr("Constant", "app.code_level_contributor.text.Jimmy-Prime", fallback: "Jimmy Prime") - /// Kai Chen - internal static let remlostime = L10n.tr("Constant", "app.code_level_contributor.text.remlostime", fallback: "Kai Chen") /// Tatsuzo Araki internal static let tatsuz0u = L10n.tr("Constant", "app.code_level_contributor.text.tatsuz0u", fallback: "Tatsuzo Araki") + /// vvbbnn00 + internal static let vvbbnn00 = L10n.tr("Constant", "app.code_level_contributor.text.vvbbnn00", fallback: "vvbbnn00") /// xioxin internal static let xioxin = L10n.tr("Constant", "app.code_level_contributor.text.xioxin", fallback: "xioxin") } @@ -484,6 +484,8 @@ internal enum L10n { internal static func browsingCountry(_ p1: Any) -> String { return L10n.tr("Localizable", "eh_setting_view.description.browsing_country", String(describing: p1), fallback: "You appear to be browsing the site from **%@** or use a VPN or proxy in this country, which means the site will try to load images from H@H clients in this general geographic region. If this is incorrect, or if you want to use a different region for any reason (like if you are using a split tunneling VPN), you can select a different country below.") } + /// The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes. + internal static let coverScaleFactor = L10n.tr("Localizable", "eh_setting_view.description.cover_scale_factor", fallback: "The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes.") /// Which display mode would you like to use on the front and search pages? internal static let displayMode = L10n.tr("Localizable", "eh_setting_view.description.display_mode", fallback: "Which display mode would you like to use on the front and search pages?") /// If you wish to hide galleries in certain languages from the gallery list and searches, select them from the list below. Note that matching galleries will never appear regardless of your search query. @@ -511,13 +513,13 @@ internal enum L10n { /// This setting can be used if you have a H@H client running on your local network with the same public IP you browse the site with. Some routers are buggy and cannot route requests back to its own IP; this allows you to work around this problem. /// If you are running the client on the same device you browse from, use the loopback address (127.0.0.1:port). If the client is running on another device on your network, use its local network IP. Some browser configurations prevent external web sites from accessing URLs with local network IPs, the site must then be whitelisted for this to work. internal static let ipAddressPort = L10n.tr("Localizable", "eh_setting_view.description.ip_address_port", fallback: "This setting can be used if you have a H@H client running on your local network with the same public IP you browse the site with. Some routers are buggy and cannot route requests back to its own IP; this allows you to work around this problem.\nIf you are running the client on the same device you browse from, use the loopback address (127.0.0.1:port). If the client is running on another device on your network, use its local network IP. Some browser configurations prevent external web sites from accessing URLs with local network IPs, the site must then be whitelisted for this to work.") + /// Some historic UI elements are now disabled by default. You can enable those here. + internal static let optionalUIElements = L10n.tr("Localizable", "eh_setting_view.description.optional_UI_elements", fallback: "Some historic UI elements are now disabled by default. You can enable those here.") /// By default, galleries that you have rated will appear with red stars for ratings of 2 stars and below, green for ratings between 2.5 and 4 stars, and blue for ratings of 4.5 or 5 stars. You can customize this by entering your desired color combination below. Each letter represents one star. The default RRGGB means R(ed) for the first and second star, G(reen) for the third and fourth, and B(lue) for the fifth. You can also use (Y)ellow for the normal stars. Any five-letter R/G/B/Y combo works. internal static let ratingsColor = L10n.tr("Localizable", "eh_setting_view.description.ratings_color", fallback: "By default, galleries that you have rated will appear with red stars for ratings of 2 stars and below, green for ratings between 2.5 and 4 stars, and blue for ratings of 4.5 or 5 stars. You can customize this by entering your desired color combination below. Each letter represents one star. The default RRGGB means R(ed) for the first and second star, G(reen) for the third and fourth, and B(lue) for the fifth. You can also use (Y)ellow for the normal stars. Any five-letter R/G/B/Y combo works.") /// How many results would you like per page for the index/search page and torrent search pages? /// (Hath Perk: Paging Enlargement Required) internal static let resultCount = L10n.tr("Localizable", "eh_setting_view.description.result_count", fallback: "How many results would you like per page for the index/search page and torrent search pages?\n(Hath Perk: Paging Enlargement Required)") - /// Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%. - internal static let scaleFactor = L10n.tr("Localizable", "eh_setting_view.description.scale_factor", fallback: "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%.") /// You can soft filter tags by adding them to My Tags with a negative weight. If a gallery has tags that add up to weight below this value, it is filtered from view. This threshold can be set between 0 and -9999. internal static let tagFilteringThreshold = L10n.tr("Localizable", "eh_setting_view.description.tag_filtering_threshold", fallback: "You can soft filter tags by adding them to My Tags with a negative weight. If a gallery has tags that add up to weight below this value, it is filtered from view. This threshold can be set between 0 and -9999.") /// Recently uploaded galleries will be included on the watched screen if it has at least one watched tag with positive weight, and the sum of weights on its watched tags add up to this value or higher. This threshold can be set between 0 and 9999. @@ -526,6 +528,8 @@ internal enum L10n { internal static let thumbnailConfiguration = L10n.tr("Localizable", "eh_setting_view.description.thumbnail_configuration", fallback: "You can set a default thumbnail configuration for all galleries you visit.") /// How would you like the mouse-over thumbnails on the front page to load when using List Mode? internal static let thumbnailLoadTiming = L10n.tr("Localizable", "eh_setting_view.description.thumbnail_load_timing", fallback: "How would you like the mouse-over thumbnails on the front page to load when using List Mode?") + /// Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%. + internal static let thumbnailScaleFactor = L10n.tr("Localizable", "eh_setting_view.description.thumbnail_scale_factor", fallback: "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%.") /// Allows you to override the virtual width of the site for mobile devices. This is normally determined automatically by your device based on its DPI. Sensible values at 100%% thumbnail scale are between 640 and 1400. internal static let virtualWidth = L10n.tr("Localizable", "eh_setting_view.description.virtual_width", fallback: "Allows you to override the virtual width of the site for mobile devices. This is normally determined automatically by your device based on its DPI. Sensible values at 100%% thumbnail scale are between 640 and 1400.") } @@ -537,6 +541,8 @@ internal enum L10n { internal enum Title { /// Archiver Settings internal static let archiverSettings = L10n.tr("Localizable", "eh_setting_view.section.title.archiver_settings", fallback: "Archiver Settings") + /// Cover Scaling + internal static let coverScaling = L10n.tr("Localizable", "eh_setting_view.section.title.cover_scaling", fallback: "Cover Scaling") /// Excluded Languages internal static let excludedLanguages = L10n.tr("Localizable", "eh_setting_view.section.title.excluded_languages", fallback: "Excluded Languages") /// Excluded Uploaders @@ -553,6 +559,8 @@ internal enum L10n { internal static let galleryNameDisplay = L10n.tr("Localizable", "eh_setting_view.section.title.gallery_name_display", fallback: "Gallery Name Display") /// Gallery Page Numbering internal static let galleryPageNumbering = L10n.tr("Localizable", "eh_setting_view.section.title.gallery_page_numbering", fallback: "Gallery Page Numbering") + /// Gallery Page Thumbnail Labeling + internal static let galleryPageThumbnailLabeling = L10n.tr("Localizable", "eh_setting_view.section.title.gallery_page_thumbnail_labeling", fallback: "Gallery Page Thumbnail Labeling") /// Gallery Tags internal static let galleryTags = L10n.tr("Localizable", "eh_setting_view.section.title.gallery_tags", fallback: "Gallery Tags") /// Hath Local Network Host @@ -563,8 +571,10 @@ internal enum L10n { internal static let imageSizeSettings = L10n.tr("Localizable", "eh_setting_view.section.title.image_size_settings", fallback: "Image Size Settings") /// Multi-Page Viewer internal static let multiPageViewer = L10n.tr("Localizable", "eh_setting_view.section.title.multi_page_viewer", fallback: "Multi-Page Viewer") - /// Original Images - internal static let originalImages = L10n.tr("Localizable", "eh_setting_view.section.title.original_images", fallback: "Original Images") + /// Optional UI Elements + internal static let optionalUIElements = L10n.tr("Localizable", "eh_setting_view.section.title.optional_UI_elements", fallback: "Optional UI Elements") + /// Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than "Auto" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year). + internal static let originalImages = L10n.tr("Localizable", "eh_setting_view.section.title.original_images", fallback: "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year).") /// Profile Settings internal static let profileSettings = L10n.tr("Localizable", "eh_setting_view.section.title.profile_settings", fallback: "Profile Settings") /// Ratings @@ -598,6 +608,8 @@ internal enum L10n { internal static let displayMode = L10n.tr("Localizable", "eh_setting_view.title.display_mode", fallback: "Display mode") /// Display style internal static let displayStyle = L10n.tr("Localizable", "eh_setting_view.title.display_style", fallback: "Display style") + /// Enable thumbnail selector on gallery screen + internal static let enableGalleryThumbnailSelector = L10n.tr("Localizable", "eh_setting_view.title.enable_gallery_thumbnail_selector", fallback: "Enable thumbnail selector on gallery screen") /// Favorites sort order internal static let favoritesSortOrder = L10n.tr("Localizable", "eh_setting_view.title.favorites_sort_order", fallback: "Favorites sort order") /// Gallery name @@ -628,6 +640,8 @@ internal enum L10n { internal static let showFilteredRemovalCount = L10n.tr("Localizable", "eh_setting_view.title.show_filtered_removal_count", fallback: "Show filtered removal count") /// Show gallery page numbers internal static let showGalleryPageNumbers = L10n.tr("Localizable", "eh_setting_view.title.show_gallery_page_numbers", fallback: "Show gallery page numbers") + /// Show label below gallery thumbnails + internal static let showLabelBelowGalleryThumbnails = L10n.tr("Localizable", "eh_setting_view.title.show_label_below_gallery_thumbnails", fallback: "Show label below gallery thumbnails") /// Show search range indicator internal static let showSearchRangeIndicator = L10n.tr("Localizable", "eh_setting_view.title.show_search_range_indicator", fallback: "Show search range indicator") /// Show thumbnail pane @@ -1313,6 +1327,20 @@ internal enum L10n { internal static let japanese = L10n.tr("Localizable", "enum.eh_setting.gallery_name.value.japanese", fallback: "Japanese Title (if available)") } } + internal enum GalleryPageNumbering { + internal enum Value { + /// No + internal static let no = L10n.tr("Localizable", "enum.eh_setting.gallery_page_numbering.value.no", fallback: "No") + /// None + internal static let `none` = L10n.tr("Localizable", "enum.eh_setting.gallery_page_numbering.value.none", fallback: "None") + /// Page Number + Name + internal static let pageNumberAndName = L10n.tr("Localizable", "enum.eh_setting.gallery_page_numbering.value.page_number_and_name", fallback: "Page Number + Name") + /// Page Number Only + internal static let pageNumberOnly = L10n.tr("Localizable", "enum.eh_setting.gallery_page_numbering.value.page_number_only", fallback: "Page Number Only") + /// Yes + internal static let yes = L10n.tr("Localizable", "enum.eh_setting.gallery_page_numbering.value.yes", fallback: "Yes") + } + } internal enum ImageResolution { internal enum Value { /// Auto @@ -1375,10 +1403,14 @@ internal enum L10n { } internal enum ThumbnailSize { internal enum Value { + /// Auto + internal static let auto = L10n.tr("Localizable", "enum.eh_setting.thumbnail_size.value.auto", fallback: "Auto") /// Large internal static let large = L10n.tr("Localizable", "enum.eh_setting.thumbnail_size.value.large", fallback: "Large") /// Normal internal static let normal = L10n.tr("Localizable", "enum.eh_setting.thumbnail_size.value.normal", fallback: "Normal") + /// Small + internal static let small = L10n.tr("Localizable", "enum.eh_setting.thumbnail_size.value.small", fallback: "Small") } } } diff --git a/EhPanda/App/Tools/Parser.swift b/EhPanda/App/Tools/Parser.swift index 1134d5b7..7e2d367b 100644 --- a/EhPanda/App/Tools/Parser.swift +++ b/EhPanda/App/Tools/Parser.swift @@ -318,7 +318,7 @@ struct Parser { let singlePageCount = Int(gpcText[rangeA.upperBound.. [Int: URL] { + var previewURLs = [Int: URL]() + + for link in node.xpath("//a") { + if let divNode = link.at_xpath("div"), + let style = divNode["style"], + let rangeA = style.range(of: "url("), + let rangeB = style.range(of: ")"), + let urlString = style[rangeA.upperBound.. Int? { + // The probable format of page title is "Page [Number]: filename" + ( + title + .components(separatedBy: ":") + .first? + .replacingOccurrences(of: "Page ", with: "") + .trimmingCharacters(in: .whitespaces) + ) + .flatMap(Int.init) + } + // MARK: ImageURL static func parseThumbnailURLs(doc: HTMLDocument) throws -> [Int: URL] { var thumbnailURLs = [Int: URL]() @@ -730,14 +765,27 @@ struct Parser { let previewMode = try? parsePreviewMode(doc: doc) else { throw AppError.parseFailed } - for link in gdtNode.xpath("//div [@class='\(previewMode)']") { - guard let aLink = link.at_xpath("//a"), - let thumbnailURLString = aLink["href"], - let thumbnailURL = URL(string: thumbnailURLString), - let index = Int(aLink.at_xpath("//img")?["alt"] ?? "") - else { continue } + if previewMode == "gt200" { + for aLink in gdtNode.xpath("a") { + guard let href = aLink["href"], + let thumbnailURL = URL(string: href), + let divNode = aLink.at_xpath("div"), + let title = divNode["title"], + let index = parseGT200IndexFromTitle(from: title) + else { continue } - thumbnailURLs[index] = thumbnailURL + thumbnailURLs[index] = thumbnailURL + } + } else { + for link in gdtNode.xpath("//div [@class='\(previewMode)']") { + guard let aLink = link.at_xpath("//a"), + let thumbnailURLString = aLink["href"], + let thumbnailURL = URL(string: thumbnailURLString), + let index = Int(aLink.at_xpath("//img")?["alt"] ?? "") + else { continue } + + thumbnailURLs[index] = thumbnailURL + } } return thumbnailURLs @@ -769,6 +817,8 @@ struct Parser { return "gdtm" } else if doc.at_xpath("//div [@class='gdtl']") != nil { return "gdtl" + } else if doc.at_xpath("//div [@class='gt200']") != nil { + return "gt200" } else { throw AppError.parseFailed } @@ -1058,7 +1108,7 @@ extension Parser { } // MARK: EhSetting - static func parseEhSetting(doc: HTMLDocument) throws -> EhSetting { + static func parseEhSetting(doc: HTMLDocument, galleryHost: GalleryHost) throws -> EhSetting { func parseInt(node: XMLElement, name: String) -> Int? { var value: Int? for link in node.xpath("//input [@name='\(name)']") @@ -1132,7 +1182,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 showSearchRangeIndicator: Bool?; var disabledCategories = [Bool](); var favoriteCategories = [String](); var favoritesSortOrder: EhSetting.FavoritesSortOrder?; var ratingsColor: String?; 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? + var ehProfiles = [EhProfile](); var isCapableOfCreatingNewProfile: Bool?; var capableLoadThroughHathSetting: EhSetting.LoadThroughHathSetting?; var capableImageResolution: EhSetting.ImageResolution?; var capableSearchResultCount: EhSetting.SearchResultCount?; var capableThumbnailConfigSizes = [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 showSearchRangeIndicator: Bool?; var enableGalleryThumbnailSelector: Bool?; var disabledCategories = [Bool](); var favoriteCategories = [String](); var favoritesSortOrder: EhSetting.FavoritesSortOrder?; var ratingsColor: String?; 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 galleryPageNumbers: EhSetting.GalleryPageNumbering?; var useOriginalImages: Bool?; var useMultiplePageViewer: Bool?; var multiplePageViewerStyle: EhSetting.MultiplePageViewerStyle?; var multiplePageViewerShowThumbnailPane: Bool? // swiftlint:enable line_length ehProfiles = parseSelections(node: profileOuter, name: "profile_set") @@ -1192,6 +1242,9 @@ extension Parser { if optouter.at_xpath("//input [@name='pp']") != nil { showSearchRangeIndicator = parseInt(node: optouter, name: "pp") == 0 } + if optouter.at_xpath("//input [@name='xn_0']") != nil { + enableGalleryThumbnailSelector = parseCheckBoxBool(node: optouter, name: "xn_0") + } if optouter.at_xpath("//div [@id='catsel']") != nil { disabledCategories = Array(0...9) .map { "ct_\(EhSetting.categoryNames[$0])" } @@ -1234,8 +1287,32 @@ extension Parser { thumbnailLoadTiming = parseEnum(node: optouter, name: "lt") } if optouter.at_xpath("//input [@name='ts']") != nil { - thumbnailConfigSize = parseEnum(node: optouter, name: "ts") - capableThumbnailConfigSize = parseCapability(node: optouter, name: "ts") + var options = [(value: Int, isEnabled: Bool, isSelected: Bool)]() + for link in optouter.xpath("//input [@name='ts']") { + if let valueString = link["value"], let value = Int(valueString) { + let isEnabled = link["disabled"] != "disabled" + let isSelected = link["checked"] == "checked" + options.append((value: value, isEnabled: isEnabled, isSelected: isSelected)) + } + } + let thumbnailSize: (Int) -> EhSetting.ThumbnailSize? = { + switch (galleryHost == .ehentai, $0) { + case (true, 0): .normal + case (true, 1): .large + case (false, 0): .auto + case (false, 1): .normal + case (false, 2): .small + default: nil + } + } + for option in options where option.isEnabled { + if let size = thumbnailSize(option.value) { + capableThumbnailConfigSizes.append(size) + } + } + if let selectedSize = (options.first(where: \.isSelected)?.value).flatMap(thumbnailSize) { + thumbnailConfigSize = selectedSize + } } if optouter.at_xpath("//input [@name='tr']") != nil { thumbnailConfigRows = parseEnum(node: optouter, name: "tr") @@ -1259,7 +1336,7 @@ extension Parser { tagsSortOrder = parseEnum(node: optouter, name: "tb") } if optouter.at_xpath("//input [@name='pn']") != nil { - galleryShowPageNumbers = parseInt(node: optouter, name: "pn") == 1 + galleryPageNumbers = parseEnum(node: optouter, name: "pn") } if optouter.at_xpath("//input [@name='oi']") != nil { useOriginalImages = parseInt(node: optouter, name: "oi") == 1 @@ -1276,10 +1353,10 @@ extension Parser { } // swiftlint:disable line_length - 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, let showSearchRangeIndicator, disabledCategories.count == 10, favoriteCategories.count == 10, let favoritesSortOrder, let ratingsColor, let tagFilteringThreshold, let tagWatchingThreshold, let showFilteredRemovalCount, 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 + guard !ehProfiles.filter(\.isSelected).isEmpty, let isCapableOfCreatingNewProfile, let capableLoadThroughHathSetting, let capableImageResolution, let capableSearchResultCount, !capableThumbnailConfigSizes.isEmpty, let capableThumbnailConfigRowCount, let loadThroughHathSetting, let browsingCountry, let literalBrowsingCountry, let imageResolution, let imageSizeWidth, let imageSizeHeight, let galleryName, let archiverBehavior, let displayMode, let showSearchRangeIndicator, let enableGalleryThumbnailSelector, disabledCategories.count == 10, favoriteCategories.count == 10, let favoritesSortOrder, let ratingsColor, let tagFilteringThreshold, let tagWatchingThreshold, let showFilteredRemovalCount, excludedLanguages.count == 50, let excludedUploaders, let searchResultCount, let thumbnailLoadTiming, let thumbnailConfigSize, let thumbnailConfigRows, let thumbnailScaleFactor, let viewportVirtualWidth, let commentsSortOrder, let commentVotesShowTiming, let tagsSortOrder, let galleryPageNumbers 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, showSearchRangeIndicator: showSearchRangeIndicator, disabledCategories: disabledCategories, favoriteCategories: favoriteCategories, favoritesSortOrder: favoritesSortOrder, ratingsColor: ratingsColor, 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 + return EhSetting(ehProfiles: ehProfiles.sorted(), isCapableOfCreatingNewProfile: isCapableOfCreatingNewProfile, capableLoadThroughHathSetting: capableLoadThroughHathSetting, capableImageResolution: capableImageResolution, capableSearchResultCount: capableSearchResultCount, capableThumbnailConfigRowCount: capableThumbnailConfigRowCount, capableThumbnailConfigSizes: capableThumbnailConfigSizes, loadThroughHathSetting: loadThroughHathSetting, browsingCountry: browsingCountry, literalBrowsingCountry: literalBrowsingCountry, imageResolution: imageResolution, imageSizeWidth: imageSizeWidth, imageSizeHeight: imageSizeHeight, galleryName: galleryName, archiverBehavior: archiverBehavior, displayMode: displayMode, showSearchRangeIndicator: showSearchRangeIndicator, enableGalleryThumbnailSelector: enableGalleryThumbnailSelector, disabledCategories: disabledCategories, favoriteCategories: favoriteCategories, favoritesSortOrder: favoritesSortOrder, ratingsColor: ratingsColor, 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, galleryPageNumbering: galleryPageNumbers, useOriginalImages: useOriginalImages, useMultiplePageViewer: useMultiplePageViewer, multiplePageViewerStyle: multiplePageViewerStyle, multiplePageViewerShowThumbnailPane: multiplePageViewerShowThumbnailPane ) // swiftlint:enable line_length } diff --git a/EhPanda/App/de.lproj/Localizable.strings b/EhPanda/App/de.lproj/Localizable.strings index 4d8c07ea..3914fd7e 100644 --- a/EhPanda/App/de.lproj/Localizable.strings +++ b/EhPanda/App/de.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "Minimal"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "Optional UI Elements"; +"eh_setting_view.description.optional_UI_elements" = "Some historic UI elements are now disabled by default. You can enable those here."; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "Enable thumbnail selector on gallery screen"; + "eh_setting_view.section.title.favorites" = "Favorites"; "eh_setting_view.description.favorite_categories" = "Here you can choose and rename your favorite categories."; "eh_setting_view.title.favorites_sort_order" = "Favorites sort order"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "Normal"; "enum.eh_setting.thumbnail_size.value.large" = "Large"; +"enum.eh_setting.thumbnail_size.value.small" = "Small"; +"enum.eh_setting.thumbnail_size.value.auto" = "Auto"; "eh_setting_view.section.title.thumbnail_scaling" = "Thumbnail Scaling"; +"eh_setting_view.section.title.cover_scaling" = "Cover Scaling"; "eh_setting_view.title.scale_factor" = "Scale factor"; -"eh_setting_view.description.scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.thumbnail_scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.cover_scale_factor" = "The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes."; "eh_setting_view.section.title.viewport_override" = "Viewport Override"; "eh_setting_view.title.virtual_width" = "Virtual width"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "By tag power"; "eh_setting_view.section.title.gallery_page_numbering" = "Gallery Page Numbering"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "Gallery Page Thumbnail Labeling"; "eh_setting_view.title.show_gallery_page_numbers" = "Show gallery page numbers"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "Show label below gallery thumbnails"; "eh_setting_view.section.title.hath_local_network_host" = "Hath Local Network Host"; "eh_setting_view.title.ip_address_port" = "IP address:Port"; "eh_setting_view.description.ip_address_port" = "This setting can be used if you have a H@H client running on your local network with the same public IP you browse the site with. Some routers are buggy and cannot route requests back to its own IP; this allows you to work around this problem.\nIf you are running the client on the same device you browse from, use the loopback address (127.0.0.1:port). If the client is running on another device on your network, use its local network IP. Some browser configurations prevent external web sites from accessing URLs with local network IPs, the site must then be whitelisted for this to work."; -"eh_setting_view.section.title.original_images" = "Original Images"; +"eh_setting_view.section.title.original_images" = "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year)."; "eh_setting_view.title.use_original_images" = "Use original images"; "eh_setting_view.section.title.multi_page_viewer" = "Multi-Page Viewer"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "Align left, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "Align center, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "Align center, always scale"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "None"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "Page Number Only"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "Page Number + Name"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "Yes"; +"enum.eh_setting.gallery_page_numbering.value.no" = "No"; // MARK: Category "enum.category.value.doujinshi" = "Doujinshi"; diff --git a/EhPanda/App/en.lproj/Constant.strings b/EhPanda/App/en.lproj/Constant.strings index c8a7a705..da2ac2d2 100644 --- a/EhPanda/App/en.lproj/Constant.strings +++ b/EhPanda/App/en.lproj/Constant.strings @@ -40,12 +40,12 @@ "app.code_level_contributor.link.chihchy" = "https://github.com/chihchy"; "app.code_level_contributor.link.Jimmy-Prime" = "https://github.com/Jimmy-Prime"; "app.code_level_contributor.link.xioxin" = "https://github.com/xioxin"; -"app.code_level_contributor.link.remlostime" = "https://github.com/remlostime"; +"app.code_level_contributor.link.vvbbnn00" = "https://github.com/vvbbnn00"; "app.code_level_contributor.text.tatsuz0u" = "Tatsuzo Araki"; "app.code_level_contributor.text.chihchy" = "Chihchy"; "app.code_level_contributor.text.Jimmy-Prime" = "Jimmy Prime"; "app.code_level_contributor.text.xioxin" = "xioxin"; -"app.code_level_contributor.text.remlostime" = "Kai Chen"; +"app.code_level_contributor.text.vvbbnn00" = "vvbbnn00"; // Translation contributor "app.translation_contributor.link.tatsuz0u" = "https://github.com/tatsuz0u"; diff --git a/EhPanda/App/en.lproj/Localizable.strings b/EhPanda/App/en.lproj/Localizable.strings index f01943a1..ad45a911 100644 --- a/EhPanda/App/en.lproj/Localizable.strings +++ b/EhPanda/App/en.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "Minimal"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "Optional UI Elements"; +"eh_setting_view.description.optional_UI_elements" = "Some historic UI elements are now disabled by default. You can enable those here."; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "Enable thumbnail selector on gallery screen"; + "eh_setting_view.section.title.favorites" = "Favorites"; "eh_setting_view.description.favorite_categories" = "Here you can choose and rename your favorite categories."; "eh_setting_view.title.favorites_sort_order" = "Favorites sort order"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "Normal"; "enum.eh_setting.thumbnail_size.value.large" = "Large"; +"enum.eh_setting.thumbnail_size.value.small" = "Small"; +"enum.eh_setting.thumbnail_size.value.auto" = "Auto"; "eh_setting_view.section.title.thumbnail_scaling" = "Thumbnail Scaling"; +"eh_setting_view.section.title.cover_scaling" = "Cover Scaling"; "eh_setting_view.title.scale_factor" = "Scale factor"; -"eh_setting_view.description.scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.thumbnail_scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.cover_scale_factor" = "The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes."; "eh_setting_view.section.title.viewport_override" = "Viewport Override"; "eh_setting_view.title.virtual_width" = "Virtual width"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "By tag power"; "eh_setting_view.section.title.gallery_page_numbering" = "Gallery Page Numbering"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "Gallery Page Thumbnail Labeling"; "eh_setting_view.title.show_gallery_page_numbers" = "Show gallery page numbers"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "Show label below gallery thumbnails"; "eh_setting_view.section.title.hath_local_network_host" = "Hath Local Network Host"; "eh_setting_view.title.ip_address_port" = "IP address:Port"; "eh_setting_view.description.ip_address_port" = "This setting can be used if you have a H@H client running on your local network with the same public IP you browse the site with. Some routers are buggy and cannot route requests back to its own IP; this allows you to work around this problem.\nIf you are running the client on the same device you browse from, use the loopback address (127.0.0.1:port). If the client is running on another device on your network, use its local network IP. Some browser configurations prevent external web sites from accessing URLs with local network IPs, the site must then be whitelisted for this to work."; -"eh_setting_view.section.title.original_images" = "Original Images"; +"eh_setting_view.section.title.original_images" = "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year)."; "eh_setting_view.title.use_original_images" = "Use original images"; "eh_setting_view.section.title.multi_page_viewer" = "Multi-Page Viewer"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "Align left, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "Align center, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "Align center, always scale"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "None"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "Page Number Only"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "Page Number + Name"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "Yes"; +"enum.eh_setting.gallery_page_numbering.value.no" = "No"; // MARK: Category "enum.category.value.doujinshi" = "Doujinshi"; diff --git a/EhPanda/App/ja.lproj/Localizable.strings b/EhPanda/App/ja.lproj/Localizable.strings index 6f5dff7e..3df53ff1 100644 --- a/EhPanda/App/ja.lproj/Localizable.strings +++ b/EhPanda/App/ja.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "最小化"; "enum.eh_setting.display_mode.value.minimalPlus" = "最小化+"; +"eh_setting_view.section.title.optional_UI_elements" = "UI の表示制御"; +"eh_setting_view.description.optional_UI_elements" = "一部の従来の UI はデフォルトで無効になっています。ここで有効にすることができます。"; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "ギャラリーのサムネイルセレクタ"; + "eh_setting_view.section.title.favorites" = "お気に入り"; "eh_setting_view.description.favorite_categories" = "ここではお気に入りカテゴリー名の変更ができます。"; "eh_setting_view.title.favorites_sort_order" = "お気に入りの並び替え"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "普通"; "enum.eh_setting.thumbnail_size.value.large" = "大きめ"; +"enum.eh_setting.thumbnail_size.value.small" = "小さめ"; +"enum.eh_setting.thumbnail_size.value.auto" = "自動"; "eh_setting_view.section.title.thumbnail_scaling" = "サムネイルスケーリング"; +"eh_setting_view.section.title.cover_scaling" = "カバースケーリング"; "eh_setting_view.title.scale_factor" = "スケール係数"; -"eh_setting_view.description.scale_factor" = "サムネイル・拡張表示モードでのサムネイルを 75%% ~ 150%% のカスタム値にスケールすることができます。"; +"eh_setting_view.description.thumbnail_scale_factor" = "サムネイル・拡張表示モードでのサムネイルを 75%% ~ 150%% のカスタム値にスケールすることができます。"; +"eh_setting_view.description.cover_scale_factor" = "サムネイル・拡張表示モードでのカバーを 75%% ~ 150%% にスケールすることができます。"; "eh_setting_view.section.title.viewport_override" = "表示領域オーバーライド"; "eh_setting_view.title.virtual_width" = "仮想幅"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "タグパワーの高い順"; "eh_setting_view.section.title.gallery_page_numbering" = "ギャラリーページ数"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "ギャラリーサムネイルのラベル"; "eh_setting_view.title.show_gallery_page_numbers" = "ギャラリーページ数を表示"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "ギャラリーサムネイルの下にラベルを表示"; "eh_setting_view.section.title.hath_local_network_host" = "Hath ローカルネットワークホスト"; "eh_setting_view.title.ip_address_port" = "IP アドレス:ポート"; "eh_setting_view.description.ip_address_port" = "ローカルネットワークで今と同じパブリック IP を使う H@H クライアントがお持ちの場合、この設定が役立ちます。ルーターがバグが多くてリクエストを自分の IP にルートすることができないこともあります、それをこの設定で回避できます。\nH@H クライアントが今と同じデバイスで運行している場合はループバックアドレス(127.0.0.1:ポート)を使ってください。別のデバイスの場合はそのローカル IP を使ってください。かなりのブラウザの構成では外部サイトがローカル IP にアクセスすることをブロックしています、この設定を有効にするには本サイトをホワイトリストに入れてください。"; -"eh_setting_view.section.title.original_images" = "オリジナル画像"; +"eh_setting_view.section.title.original_images" = "オリジナル画像を使いますか?リサンプリングされた画像は、上記の解像度で「自動」以外を選択し、該当する画像の方が幅が広い場合、またはオリジナル画像が 10 MiB(一年以上前のギャラリーの場合は 4 MiB)より大きい場合に使用されます。"; "eh_setting_view.title.use_original_images" = "オリジナル画像を使う"; "eh_setting_view.section.title.multi_page_viewer" = "マルチページビューア"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "左寄せ、幅によってスケール"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "中央揃え、幅によってスケール"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "中央揃え、常時スケール"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "表示しない"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "ページ番号のみ表示"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "ページ番号と名前を表示"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "表示する"; +"enum.eh_setting.gallery_page_numbering.value.no" = "表示しない"; // MARK: Category "enum.category.value.doujinshi" = "同人誌"; diff --git a/EhPanda/App/ko.lproj/Localizable.strings b/EhPanda/App/ko.lproj/Localizable.strings index 6f42c533..76aa3714 100644 --- a/EhPanda/App/ko.lproj/Localizable.strings +++ b/EhPanda/App/ko.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "Minimal"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "Optional UI Elements"; +"eh_setting_view.description.optional_UI_elements" = "Some historic UI elements are now disabled by default. You can enable those here."; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "Enable thumbnail selector on gallery screen"; + "eh_setting_view.section.title.favorites" = "즐겨찾기"; "eh_setting_view.description.favorite_categories" = "여기서 좋아하는 장르들을 선택하고 이름을 바꿀 수 있어요."; "eh_setting_view.title.favorites_sort_order" = "관심 순서를 배열"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "보통"; "enum.eh_setting.thumbnail_size.value.large" = "크게"; +"enum.eh_setting.thumbnail_size.value.small" = "Small"; +"enum.eh_setting.thumbnail_size.value.auto" = "Auto"; "eh_setting_view.section.title.thumbnail_scaling" = "썸네일 크기"; +"eh_setting_view.section.title.cover_scaling" = "Cover Scaling"; "eh_setting_view.title.scale_factor" = "크기 비율"; -"eh_setting_view.description.scale_factor" = "썸네일 그림 및 확장된 갤러리 목록 보기의 미리 보기는 75%에서 150%% 사이의 사용자 지정 값으로 조정할 수 있어요."; +"eh_setting_view.description.thumbnail_scale_factor" = "썸네일 그림 및 확장된 갤러리 목록 보기의 미리 보기는 75%에서 150%% 사이의 사용자 지정 값으로 조정할 수 있어요."; +"eh_setting_view.description.cover_scale_factor" = "The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes."; "eh_setting_view.section.title.viewport_override" = "뷰포트 조정"; "eh_setting_view.title.virtual_width" = "가상 너비"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "태크 가중치로"; "eh_setting_view.section.title.gallery_page_numbering" = "갤러리 페이지 번호 매기기"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "Gallery Page Thumbnail Labeling"; "eh_setting_view.title.show_gallery_page_numbers" = "갤러리 페이지 번호 보이기"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "Show label below gallery thumbnails"; "eh_setting_view.section.title.hath_local_network_host" = "Hath 로컬 네트워크 호스트"; "eh_setting_view.title.ip_address_port" = "IP주소:포트"; "eh_setting_view.description.ip_address_port" = "이 설정은 사이트를 검색하는 것과 동일한 공용 IP로 로컬 네트워크에서 H@H 클라이언트를 실행하는 경우 사용할 수 있습니다. 일부 라우터는 버그가 있어 요청을 자신의 IP로 다시 라우팅할 수 없기에, 아래를 따라서 이 문제를 해결할 수 있습니다.\n찾아보는 동일한 장치에서 클라이언트를 실행하는 경우 루프백 주소(127.0.0.1:port)를 사용할 수 있습니다. 클라이언트가 네트워크의 다른 장치에서 실행 중인 경우 로컬 네트워크 IP를 사용할 수 있습니다. 일부 브라우저 구성에서는 외부 웹 사이트가 로컬 네트워크 IP가 있는 URL에 액세스할 수 없도록 합니다. 그런 다음 사이트가 작동하려면 사이트를 화이트리스트에 추가해야 합니다."; -"eh_setting_view.section.title.original_images" = "원본 이미지"; +"eh_setting_view.section.title.original_images" = "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year)."; "eh_setting_view.title.use_original_images" = "원본 뷰어 적용"; "eh_setting_view.section.title.multi_page_viewer" = "멀티 페이지 뷰어"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "왼쪽 정렬, 너비 초과할 때 크기 맞추기"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "가운데 정렬, 너비 초과할 때 크기 맞추기"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "가운데 정렬, 항상 크기 맞추기"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "None"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "Page Number Only"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "Page Number + Name"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "Yes"; +"enum.eh_setting.gallery_page_numbering.value.no" = "No"; // MARK: Category "enum.category.value.doujinshi" = "동인지"; diff --git a/EhPanda/App/zh-Hans.lproj/Localizable.strings b/EhPanda/App/zh-Hans.lproj/Localizable.strings index 75a7e1b7..79dde9b3 100644 --- a/EhPanda/App/zh-Hans.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hans.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "最小化"; "enum.eh_setting.display_mode.value.minimalPlus" = "最小化 +"; +"eh_setting_view.section.title.optional_UI_elements" = "可选的 UI 组件"; +"eh_setting_view.description.optional_UI_elements" = "一些旧版 UI 组件现已默认禁用。您可以在此启用这些组件。"; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "在画廊页面启用缩图选择器"; + "eh_setting_view.section.title.favorites" = "收藏"; "eh_setting_view.description.favorite_categories" = "在这里你可以重命名你的收藏夹。"; "eh_setting_view.title.favorites_sort_order" = "收藏排序方式"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "普通"; "enum.eh_setting.thumbnail_size.value.large" = "较大"; +"enum.eh_setting.thumbnail_size.value.small" = "较小"; +"enum.eh_setting.thumbnail_size.value.auto" = "自动"; "eh_setting_view.section.title.thumbnail_scaling" = "缩略图缩放"; +"eh_setting_view.section.title.cover_scaling" = "封面缩放"; "eh_setting_view.title.scale_factor" = "缩放比例"; -"eh_setting_view.description.scale_factor" = "缩略图和扩展模式下的画廊列表缩略图可以缩放为 75%% 到 150%% 之间的自定义值。"; +"eh_setting_view.description.thumbnail_scale_factor" = "缩略图和扩展模式下的画廊列表缩略图可以缩放为 75%% 到 150%% 之间的自定义值。"; +"eh_setting_view.description.cover_scale_factor" = "缩略图和扩展模式下的画廊列表封面可以缩放为 75%% 到 150%% 之间的值。"; "eh_setting_view.section.title.viewport_override" = "覆写可视区域"; "eh_setting_view.title.virtual_width" = "虚拟宽度"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "按标签权重"; "eh_setting_view.section.title.gallery_page_numbering" = "画廊页面页码"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "画廊页面缩略图标签"; "eh_setting_view.title.show_gallery_page_numbers" = "显示画廊页码"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "在画廊缩略图下方显示标签"; "eh_setting_view.section.title.hath_local_network_host" = "Hath 本地网络服务器"; "eh_setting_view.title.ip_address_port" = "IP 地址:端口"; "eh_setting_view.description.ip_address_port" = "如果你本地安装了 H@H 客户端,本地 IP 与浏览网站的公共 IP 相同,一些路由器不支持回流导致无法访问到自己,你可以设置这里来解决。\n如果在同一台设备上访问网站和运行客户端,请使用本地回环地址 (127.0.0.1:端口号)。如果客户端在网络上的其它设备运行,请使用那台机器的内网 IP。某些浏览器的配置可能阻止外部网站访问本地网络,你必须将网站列入白名单才能工作。"; -"eh_setting_view.section.title.original_images" = "原始图像"; +"eh_setting_view.section.title.original_images" = "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year)."; "eh_setting_view.title.use_original_images" = "显示原图"; "eh_setting_view.section.title.multi_page_viewer" = "多页查看器"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "左对齐,图像过宽时缩放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "居中对齐,图像过宽时缩放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "居中对齐,图像始终缩放"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "不显示"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "仅显示页码"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "显示页码和名称"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "显示"; +"enum.eh_setting.gallery_page_numbering.value.no" = "不显示"; // MARK: Category "enum.category.value.doujinshi" = "同人志"; diff --git a/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings b/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings index 13fecb7d..17aaac61 100644 --- a/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "Minimal"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "Optional UI Elements"; +"eh_setting_view.description.optional_UI_elements" = "Some historic UI elements are now disabled by default. You can enable those here."; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "Enable thumbnail selector on gallery screen"; + "eh_setting_view.section.title.favorites" = "Favorites"; "eh_setting_view.description.favorite_categories" = "Here you can choose and rename your favorite categories."; "eh_setting_view.title.favorites_sort_order" = "Favorites sort order"; @@ -480,10 +484,6 @@ "eh_setting_view.section.title.excluded_languages" = "Excluded Languages"; "eh_setting_view.description.excluded_languages" = "If you wish to hide galleries in certain languages from the gallery list and searches, select them from the list below. Note that matching galleries will never appear regardless of your search query."; - -"eh.setting.view.section.title.excludedLanguages" = "Excluded Languages"; -"eh.setting.view.description.excludedLanguages" = "If you wish to hide galleries in certain languages from the gallery list and searches, select them from the list below. Note that matching galleries will never appear regardless of your search query."; ->>>>>>> develop // EhSetting.ExcludedLanguagesCategory "enum.eh_setting.excluded_languages_category.value.original" = "Original"; "enum.eh_setting.excluded_languages_category.value.translated" = "Translated"; @@ -511,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "Normal"; "enum.eh_setting.thumbnail_size.value.large" = "Large"; +"enum.eh_setting.thumbnail_size.value.small" = "Small"; +"enum.eh_setting.thumbnail_size.value.auto" = "Auto"; "eh_setting_view.section.title.thumbnail_scaling" = "Thumbnail Scaling"; +"eh_setting_view.section.title.cover_scaling" = "Cover Scaling"; "eh_setting_view.title.scale_factor" = "Scale factor"; -"eh_setting_view.description.scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.thumbnail_scale_factor" = "Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75%% and 150%%."; +"eh_setting_view.description.cover_scale_factor" = "The cover size in gallery list views can be scaled to between 75%% and 150%% when using the Thumbnail or Extended display modes."; "eh_setting_view.section.title.viewport_override" = "Viewport Override"; "eh_setting_view.title.virtual_width" = "Virtual width"; @@ -538,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "By tag power"; "eh_setting_view.section.title.gallery_page_numbering" = "Gallery Page Numbering"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "Gallery Page Thumbnail Labeling"; "eh_setting_view.title.show_gallery_page_numbers" = "Show gallery page numbers"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "Show label below gallery thumbnails"; "eh_setting_view.section.title.hath_local_network_host" = "Hath Local Network Host"; "eh_setting_view.title.ip_address_port" = "IP address:Port"; "eh_setting_view.description.ip_address_port" = "This setting can be used if you have a H@H client running on your local network with the same public IP you browse the site with. Some routers are buggy and cannot route requests back to its own IP; this allows you to work around this problem.\nIf you are running the client on the same device you browse from, use the loopback address (127.0.0.1:port). If the client is running on another device on your network, use its local network IP. Some browser configurations prevent external web sites from accessing URLs with local network IPs, the site must then be whitelisted for this to work."; -"eh_setting_view.section.title.original_images" = "Original Images"; +"eh_setting_view.section.title.original_images" = "Use original images instead of the resampled versions? Resampled images will still be used if you select a horizontal resolution different than \"Auto\" above and the image in question is wider, or if the original image is larger than 10 MiB (or 4 MiB for galleries older than one year)."; "eh_setting_view.title.use_original_images" = "Use original images"; "eh_setting_view.section.title.multi_page_viewer" = "Multi-Page Viewer"; @@ -555,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "Align left, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "Align center, scale if overwidth"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "Align center, always scale"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "None"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "Page Number Only"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "Page Number + Name"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "Yes"; +"enum.eh_setting.gallery_page_numbering.value.no" = "No"; // MARK: Category "enum.category.value.doujinshi" = "同人誌"; diff --git a/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings b/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings index 722e382e..5cb5c7f6 100644 --- a/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "最小(Minimal)"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "可選用的 UI 元件"; +"eh_setting_view.description.optional_UI_elements" = "一些舊版 UI 元件現已預設停用。您可以在此啟用這些元件。"; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "在畫廊頁面啟用縮圖選擇器"; + "eh_setting_view.section.title.favorites" = "收藏匣"; "eh_setting_view.description.favorite_categories" = "在這裡你可以選擇並重新命名收藏匣"; "eh_setting_view.title.favorites_sort_order" = "收藏匣排序"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "正常"; "enum.eh_setting.thumbnail_size.value.large" = "大型"; +"enum.eh_setting.thumbnail_size.value.small" = "小型"; +"enum.eh_setting.thumbnail_size.value.auto" = "自動"; "eh_setting_view.section.title.thumbnail_scaling" = "縮圖縮放"; +"eh_setting_view.section.title.cover_scaling" = "封面縮放"; "eh_setting_view.title.scale_factor" = "縮放比例"; -"eh_setting_view.description.scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; +"eh_setting_view.description.thumbnail_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; +"eh_setting_view.description.cover_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,封面的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.section.title.viewport_override" = "視窗覆蓋"; "eh_setting_view.title.virtual_width" = "虛擬寬度"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "標籤權重"; "eh_setting_view.section.title.gallery_page_numbering" = "畫廊頁數"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "畫廊頁面縮圖標籤"; "eh_setting_view.title.show_gallery_page_numbers" = "顯示該畫廊的頁數"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "在畫廊縮圖下方顯示標籤"; "eh_setting_view.section.title.hath_local_network_host" = "內網 H@H 服務 (Hath Local Network Host)"; "eh_setting_view.title.ip_address_port" = "IP 位址:連接埠號"; "eh_setting_view.description.ip_address_port" = "如果你在內網上使用與瀏覽站點相同的公共 IP 架設 H@H 用戶端,有些路由器會因此發生問題,無法將請求傳回自己的 IP,透過啟用這項設定可以解決此問題。\n如果您在瀏覽的同一裝置上運行用戶端,請使用回環地址 (127.0.0.1:port)。 如果用戶端在您網路上的另一台裝置上運行,請使用其本地網路 IP。 某些瀏覽器配置會阻止外部網站存取具有本地網路 IP 的 URL,你必須將站點列入白名單才能使其正常工作。"; -"eh_setting_view.section.title.original_images" = "原始圖片"; +"eh_setting_view.section.title.original_images" = "要使用原始圖片而非重新取樣的版本嗎? 若您在上方選擇「自動」以外的水平解析度且圖片較寬,或原始圖片大於 10 MiB(一年以上的圖庫則為 4 MiB),系統仍會使用重新取樣的圖片。"; "eh_setting_view.title.use_original_images" = "使用原始圖片(原解析度)"; "eh_setting_view.section.title.multi_page_viewer" = "多頁瀏覽"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "向左對齊,若寬度超出頁面則進行縮放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "置中對齊,若寬度超出頁面則進行縮放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "置中對齊且總是縮放"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "不顯示"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "只顯示頁碼"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "顯示頁碼和名稱"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "顯示"; +"enum.eh_setting.gallery_page_numbering.value.no" = "不顯示"; // MARK: Category "enum.category.value.doujinshi" = "同人誌"; diff --git a/EhPanda/App/zh-Hant.lproj/Localizable.strings b/EhPanda/App/zh-Hant.lproj/Localizable.strings index e317ade9..a7ceb359 100644 --- a/EhPanda/App/zh-Hant.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant.lproj/Localizable.strings @@ -453,6 +453,10 @@ "enum.eh_setting.display_mode.value.minimal" = "最小(Minimal)"; "enum.eh_setting.display_mode.value.minimalPlus" = "Minimal+"; +"eh_setting_view.section.title.optional_UI_elements" = "可選用的 UI 元件"; +"eh_setting_view.description.optional_UI_elements" = "一些舊版 UI 元件現已預設停用。您可以在此啟用這些元件。"; +"eh_setting_view.title.enable_gallery_thumbnail_selector" = "在畫廊頁面啟用縮圖選擇器"; + "eh_setting_view.section.title.favorites" = "收藏匣"; "eh_setting_view.description.favorite_categories" = "在這裡你可以選擇並重新命名收藏匣"; "eh_setting_view.title.favorites_sort_order" = "收藏匣排序"; @@ -507,10 +511,14 @@ // EhSetting.ThumbnailSize "enum.eh_setting.thumbnail_size.value.normal" = "正常"; "enum.eh_setting.thumbnail_size.value.large" = "大型"; +"enum.eh_setting.thumbnail_size.value.small" = "小型"; +"enum.eh_setting.thumbnail_size.value.auto" = "自動"; "eh_setting_view.section.title.thumbnail_scaling" = "縮圖縮放"; +"eh_setting_view.section.title.cover_scaling" = "封面縮放"; "eh_setting_view.title.scale_factor" = "縮放比例"; -"eh_setting_view.description.scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; +"eh_setting_view.description.thumbnail_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; +"eh_setting_view.description.cover_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,封面的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.section.title.viewport_override" = "視窗覆蓋"; "eh_setting_view.title.virtual_width" = "虛擬寬度"; @@ -534,13 +542,15 @@ "enum.eh_setting.tags_sort_order.value.tag_power" = "標籤權重"; "eh_setting_view.section.title.gallery_page_numbering" = "畫廊頁數"; +"eh_setting_view.section.title.gallery_page_thumbnail_labeling" = "畫廊頁面縮圖標籤"; "eh_setting_view.title.show_gallery_page_numbers" = "顯示該畫廊的頁數"; +"eh_setting_view.title.show_label_below_gallery_thumbnails" = "在畫廊縮圖下方顯示標籤"; "eh_setting_view.section.title.hath_local_network_host" = "內網 H@H 服務 (Hath Local Network Host)"; "eh_setting_view.title.ip_address_port" = "IP 位址:連接埠號"; "eh_setting_view.description.ip_address_port" = "如果你在內網上使用與瀏覽站點相同的公共 IP 架設 H@H 用戶端,有些路由器會因此發生問題,無法將請求傳回自己的 IP,透過啟用這項設定可以解決此問題。\n如果您在瀏覽的同一裝置上運行用戶端,請使用回環地址 (127.0.0.1:port)。 如果用戶端在您網路上的另一台裝置上運行,請使用其本地網路 IP。 某些瀏覽器配置會阻止外部網站存取具有本地網路 IP 的 URL,你必須將站點列入白名單才能使其正常工作。"; -"eh_setting_view.section.title.original_images" = "原始圖片"; +"eh_setting_view.section.title.original_images" = "要使用原始圖片而非重新取樣的版本嗎? 若您在上方選擇「自動」以外的水平解析度且圖片較寬,或原始圖片大於 10 MiB(一年以上的圖庫則為 4 MiB),系統仍會使用重新取樣的圖片。"; "eh_setting_view.title.use_original_images" = "使用原始圖片(原解析度)"; "eh_setting_view.section.title.multi_page_viewer" = "多頁瀏覽"; @@ -551,6 +561,12 @@ "enum.eh_setting.multiple_page_viewer_style.value.align_left_scale_if_over_width" = "向左對齊,若寬度超出頁面則進行縮放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_scale_if_over_width" = "置中對齊,若寬度超出頁面則進行縮放"; "enum.eh_setting.multiple_page_viewer_style.value.align_center_always_scale" = "置中對齊且總是縮放"; +// EhSetting.GalleryPageNumbering +"enum.eh_setting.gallery_page_numbering.value.none" = "不顯示"; +"enum.eh_setting.gallery_page_numbering.value.page_number_only" = "只顯示頁碼"; +"enum.eh_setting.gallery_page_numbering.value.page_number_and_name" = "顯示頁碼和名稱"; +"enum.eh_setting.gallery_page_numbering.value.yes" = "顯示"; +"enum.eh_setting.gallery_page_numbering.value.no" = "不顯示"; // MARK: Category "enum.category.value.doujinshi" = "同人誌"; diff --git a/EhPanda/Models/Support/EhSetting.swift b/EhPanda/Models/Support/EhSetting.swift index 75c27730..e1420218 100644 --- a/EhPanda/Models/Support/EhSetting.swift +++ b/EhPanda/Models/Support/EhSetting.swift @@ -8,7 +8,7 @@ // MARK: EhSetting struct EhSetting: Equatable { // swiftlint:disable line_length - static let empty: Self = .init(ehProfiles: [.empty], isCapableOfCreatingNewProfile: true, capableLoadThroughHathSetting: .anyClient, capableImageResolution: .auto, capableSearchResultCount: .fifty, capableThumbnailConfigSize: .normal, capableThumbnailConfigRowCount: .forty, loadThroughHathSetting: .anyClient, browsingCountry: .autoDetect, literalBrowsingCountry: "", imageResolution: .auto, imageSizeWidth: 0, imageSizeHeight: 0, galleryName: .default, archiverBehavior: .autoSelectOriginalAutoStart, displayMode: .compact, showSearchRangeIndicator: true, disabledCategories: Array(repeating: false, count: 10), favoriteCategories: Array(repeating: "", count: 10), favoritesSortOrder: .favoritedTime, ratingsColor: "", tagFilteringThreshold: 0, tagWatchingThreshold: 0, showFilteredRemovalCount: true, excludedLanguages: Array(repeating: false, count: 50), excludedUploaders: "", searchResultCount: .fifty, thumbnailLoadTiming: .onPageLoad, thumbnailConfigSize: .normal, thumbnailConfigRows: .ten, thumbnailScaleFactor: 0, viewportVirtualWidth: 0, commentsSortOrder: .recent, commentVotesShowTiming: .always, tagsSortOrder: .alphabetical, galleryShowPageNumbers: true) + static let empty: Self = .init(ehProfiles: [.empty], isCapableOfCreatingNewProfile: true, capableLoadThroughHathSetting: .anyClient, capableImageResolution: .auto, capableSearchResultCount: .fifty, capableThumbnailConfigRowCount: .forty, capableThumbnailConfigSizes: [], loadThroughHathSetting: .anyClient, browsingCountry: .autoDetect, literalBrowsingCountry: "", imageResolution: .auto, imageSizeWidth: 0, imageSizeHeight: 0, galleryName: .default, archiverBehavior: .autoSelectOriginalAutoStart, displayMode: .compact, showSearchRangeIndicator: true, enableGalleryThumbnailSelector: false, disabledCategories: Array(repeating: false, count: 10), favoriteCategories: Array(repeating: "", count: 10), favoritesSortOrder: .favoritedTime, ratingsColor: "", tagFilteringThreshold: 0, tagWatchingThreshold: 0, showFilteredRemovalCount: true, excludedLanguages: Array(repeating: false, count: 50), excludedUploaders: "", searchResultCount: .fifty, thumbnailLoadTiming: .onPageLoad, thumbnailConfigSize: .normal, thumbnailConfigRows: .ten, thumbnailScaleFactor: 0, viewportVirtualWidth: 0, commentsSortOrder: .recent, commentVotesShowTiming: .always, tagsSortOrder: .alphabetical, galleryPageNumbering: .none) // swiftlint:enable line_length static let categoryNames = Category.allFiltersCases.map(\.rawValue).map { value in @@ -35,8 +35,8 @@ struct EhSetting: Equatable { let capableLoadThroughHathSetting: LoadThroughHathSetting let capableImageResolution: ImageResolution let capableSearchResultCount: SearchResultCount - let capableThumbnailConfigSize: ThumbnailSize let capableThumbnailConfigRowCount: ThumbnailRowCount + let capableThumbnailConfigSizes: [ThumbnailSize] var capableLoadThroughHathSettings: [LoadThroughHathSetting] { LoadThroughHathSetting.allCases.filter { setting in @@ -53,16 +53,14 @@ struct EhSetting: Equatable { count <= capableSearchResultCount } } - var capableThumbnailConfigSizes: [ThumbnailSize] { - ThumbnailSize.allCases.filter { size in - size <= capableThumbnailConfigSize - } - } var capableThumbnailConfigRowCounts: [ThumbnailRowCount] { ThumbnailRowCount.allCases.filter { row in row <= capableThumbnailConfigRowCount } } + func capableGalleryPageNumberingOptions(galleryHost: GalleryHost) -> [GalleryPageNumbering] { + galleryHost == .ehentai ? [.none, .pageNumberOnly] : [.none, .pageNumberOnly, .pageNumberAndName] + } var localizedLiteralBrowsingCountry: String? { BrowsingCountry.allCases.first(where: { $0.englishName == literalBrowsingCountry })?.name } @@ -77,6 +75,7 @@ struct EhSetting: Equatable { var archiverBehavior: ArchiverBehavior var displayMode: DisplayMode var showSearchRangeIndicator: Bool + var enableGalleryThumbnailSelector: Bool var disabledCategories: [Bool] var favoriteCategories: [String] var favoritesSortOrder: FavoritesSortOrder @@ -95,7 +94,7 @@ struct EhSetting: Equatable { var commentsSortOrder: CommentsSortOrder var commentVotesShowTiming: CommentVotesShowTiming var tagsSortOrder: TagsSortOrder - var galleryShowPageNumbers: Bool + var galleryPageNumbering: GalleryPageNumbering var useOriginalImages: Bool? var useMultiplePageViewer: Bool? var multiplePageViewerStyle: MultiplePageViewerStyle? @@ -389,6 +388,8 @@ extension EhSetting.ThumbnailLoadTiming { // MARK: ThumbnailSize extension EhSetting { enum ThumbnailSize: Int, CaseIterable, Identifiable, Comparable { + case auto + case small case normal case large } @@ -405,6 +406,10 @@ extension EhSetting.ThumbnailSize { return L10n.Localizable.Enum.EhSetting.ThumbnailSize.Value.normal case .large: return L10n.Localizable.Enum.EhSetting.ThumbnailSize.Value.large + case .small: + return L10n.Localizable.Enum.EhSetting.ThumbnailSize.Value.small + case .auto: + return L10n.Localizable.Enum.EhSetting.ThumbnailSize.Value.auto } } } @@ -424,16 +429,12 @@ extension EhSetting.ThumbnailRowCount { lhs.rawValue < rhs.rawValue } - var value: String { + func value(galleryHost: GalleryHost) -> String { switch self { - case .four: - return "4" - case .ten: - return "10" - case .twenty: - return "20" - case .forty: - return "40" + case .four: "4" + case .ten: galleryHost == .ehentai ? "10" : "8" + case .twenty: "20" + case .forty: "40" } } } @@ -523,3 +524,32 @@ extension EhSetting.MultiplePageViewerStyle { } } } + +// MARK: GalleryPageNumbering +extension EhSetting { + enum GalleryPageNumbering: Int, CaseIterable, Identifiable { + case none + case pageNumberOnly + case pageNumberAndName + } +} +extension EhSetting.GalleryPageNumbering { + var id: Int { rawValue } + + func value(galleryHost: GalleryHost) -> String { + switch self { + case .none: + return galleryHost == .ehentai + ? L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.no + : L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.none + + case .pageNumberOnly: + return galleryHost == .ehentai + ? L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.yes + : L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.pageNumberOnly + + case .pageNumberAndName: + return L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.pageNumberAndName + } + } +} diff --git a/EhPanda/Network/Request.swift b/EhPanda/Network/Request.swift index 7765e44f..9c0f37cb 100644 --- a/EhPanda/Network/Request.swift +++ b/EhPanda/Network/Request.swift @@ -751,6 +751,7 @@ struct VerifyEhProfileRequest: Request { } struct EhProfileRequest: Request { + let galleryHost: GalleryHost var action: EhProfileAction? var name: String? var set: Int? @@ -776,24 +777,27 @@ struct EhProfileRequest: Request { return URLSession.shared.dataTaskPublisher(for: request) .genericRetry() .tryMap { try Kanna.HTML(html: $0.data, encoding: .utf8) } - .tryMap(Parser.parseEhSetting) + .tryMap({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) .mapError(mapAppError) .eraseToAnyPublisher() } } struct EhSettingRequest: Request { + let galleryHost: GalleryHost + var publisher: AnyPublisher { URLSession.shared.dataTaskPublisher(for: Defaults.URL.uConfig) .genericRetry() .tryMap { try Kanna.HTML(html: $0.data, encoding: .utf8) } - .tryMap(Parser.parseEhSetting) + .tryMap({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) .mapError(mapAppError) .eraseToAnyPublisher() } } struct SubmitEhSettingChangesRequest: Request { + let galleryHost: GalleryHost let ehSetting: EhSetting var publisher: AnyPublisher { @@ -816,17 +820,29 @@ struct SubmitEhSettingChangesRequest: Request { "xu": ehSetting.excludedUploaders, "rc": String(ehSetting.searchResultCount.rawValue), "lt": String(ehSetting.thumbnailLoadTiming.rawValue), - "ts": String(ehSetting.thumbnailConfigSize.rawValue), "tr": String(ehSetting.thumbnailConfigRows.rawValue), "tp": String(Int(ehSetting.thumbnailScaleFactor)), "vp": String(Int(ehSetting.viewportVirtualWidth)), "cs": String(ehSetting.commentsSortOrder.rawValue), "sc": String(ehSetting.commentVotesShowTiming.rawValue), "tb": String(ehSetting.tagsSortOrder.rawValue), - "pn": ehSetting.galleryShowPageNumbers ? "1" : "0", + "pn": String(ehSetting.galleryPageNumbering.rawValue), "apply": "Apply" ] + if ehSetting.enableGalleryThumbnailSelector { + params["xn_0"] = "on" + } + + switch (galleryHost, ehSetting.thumbnailConfigSize) { + case (.ehentai, .normal): params["ts"] = "0" + case (.ehentai, .large): params["ts"] = "1" + case (.exhentai, .auto): params["ts"] = "0" + case (.exhentai, .normal): params["ts"] = "1" + case (.exhentai, .small): params["ts"] = "2" + default: break + } + EhSetting.categoryNames.enumerated().forEach { index, name in params["ct_\(name)"] = ehSetting.disabledCategories[index] ? "1" : "0" } @@ -860,7 +876,7 @@ struct SubmitEhSettingChangesRequest: Request { return URLSession.shared.dataTaskPublisher(for: request) .genericRetry() .tryMap { try Kanna.HTML(html: $0.data, encoding: .utf8) } - .tryMap(Parser.parseEhSetting) + .tryMap({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) .mapError(mapAppError) .eraseToAnyPublisher() } diff --git a/EhPanda/View/Detail/DetailView.swift b/EhPanda/View/Detail/DetailView.swift index e5ec7aa1..901addbd 100644 --- a/EhPanda/View/Detail/DetailView.swift +++ b/EhPanda/View/Detail/DetailView.swift @@ -33,6 +33,7 @@ struct DetailView: View { var body: some View { ZStack { ScrollView(showsIndicators: false) { + let content = VStack(spacing: 30) { HeaderSection( gallery: store.gallery, @@ -106,7 +107,14 @@ struct DetailView: View { ) } .padding(.bottom, 20) - .padding(.top, -25) + + if #available(iOS 18.0, *) { + content + .padding(.top, 25) + } else { + content + .padding(.top, -25) + } } .opacity(store.galleryDetail == nil ? 0 : 1) LoadingView() diff --git a/EhPanda/View/Setting/Components/AboutView.swift b/EhPanda/View/Setting/Components/AboutView.swift index 8f71d192..5ac995c7 100644 --- a/EhPanda/View/Setting/Components/AboutView.swift +++ b/EhPanda/View/Setting/Components/AboutView.swift @@ -119,8 +119,8 @@ struct AboutView: View { text: L10n.Constant.App.CodeLevelContributor.Text.xioxin ), .init( - urlString: L10n.Constant.App.CodeLevelContributor.Link.remlostime, - text: L10n.Constant.App.CodeLevelContributor.Text.remlostime + urlString: L10n.Constant.App.CodeLevelContributor.Link.vvbbnn00, + text: L10n.Constant.App.CodeLevelContributor.Text.vvbbnn00 ) ]}() diff --git a/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift b/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift index 26471655..d403625b 100644 --- a/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift +++ b/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift @@ -45,11 +45,11 @@ struct EhSettingReducer { case setDefaultProfile(Int) case teardown - case fetchEhSetting + case fetchEhSetting(galleryHost: GalleryHost) case fetchEhSettingDone(Result) - case submitChanges + case submitChanges(galleryHost: GalleryHost) case submitChangesDone(Result) - case performAction(EhProfileAction?, String?, Int) + case performAction(galleryHost: GalleryHost, action: EhProfileAction?, name: String?, set: Int) case performActionDone(Result) } @@ -82,11 +82,11 @@ struct EhSettingReducer { case .teardown: return .merge(CancelID.allCases.map(Effect.cancel(id:))) - case .fetchEhSetting: + case .fetchEhSetting(let galleryHost): guard state.loadingState != .loading else { return .none } state.loadingState = .loading return .run { send in - let response = await EhSettingRequest().response() + let response = await EhSettingRequest(galleryHost: galleryHost).response() await send(.fetchEhSettingDone(response)) } .cancellable(id: CancelID.fetchEhSetting) @@ -102,14 +102,17 @@ struct EhSettingReducer { } return .none - case .submitChanges: + case .submitChanges(let galleryHost): guard state.submittingState != .loading, let ehSetting = state.ehSetting else { return .none } state.submittingState = .loading return .run { send in - let response = await SubmitEhSettingChangesRequest(ehSetting: ehSetting).response() + let response = await SubmitEhSettingChangesRequest( + galleryHost: galleryHost, ehSetting: ehSetting + ) + .response() await send(.submitChangesDone(response)) } .cancellable(id: CancelID.submitChanges) @@ -125,11 +128,14 @@ struct EhSettingReducer { } return .none - case .performAction(let action, let name, let set): + case .performAction(let galleryHost, let action, let name, let set): guard state.submittingState != .loading else { return .none } state.submittingState = .loading return .run { send in - let response = await EhProfileRequest(action: action, name: name, set: set).response() + let response = await EhProfileRequest( + galleryHost: galleryHost, action: action, name: name, set: set + ) + .response() await send(.performActionDone(response)) } .cancellable(id: CancelID.performAction) diff --git a/EhPanda/View/Setting/EhSetting/EhSettingView.swift b/EhPanda/View/Setting/EhSetting/EhSettingView.swift index ae9d2fd2..d149199b 100644 --- a/EhPanda/View/Setting/EhSetting/EhSettingView.swift +++ b/EhPanda/View/Setting/EhSetting/EhSettingView.swift @@ -13,6 +13,9 @@ struct EhSettingView: View { private let bypassesSNIFiltering: Bool private let blurRadius: Double + // Should make it an Environment value. + private var galleryHost: GalleryHost { AppUtil.galleryHost } + init(store: StoreOf, bypassesSNIFiltering: Bool, blurRadius: Double) { self.store = store self.bypassesSNIFiltering = bypassesSNIFiltering @@ -27,7 +30,7 @@ struct EhSettingView: View { LoadingView() .tint(nil) } else if case .failed(let error) = store.loadingState { - ErrorView(error: error, action: { store.send(.fetchEhSetting) }) + ErrorView(error: error, action: { store.send(.fetchEhSetting(galleryHost: galleryHost)) }) .tint(nil) } // Using `Binding.init` will crash the app @@ -40,7 +43,7 @@ struct EhSettingView: View { } .onAppear { if store.ehSetting == nil { - store.send(.fetchEhSetting) + store.send(.fetchEhSetting(galleryHost: galleryHost)) } } .onDisappear { @@ -53,7 +56,7 @@ struct EhSettingView: View { .autoBlur(radius: blurRadius) } .toolbar(content: toolbar) - .navigationTitle(L10n.Localizable.EhSettingView.Title.hostSettings(AppUtil.galleryHost.rawValue)) + .navigationTitle(L10n.Localizable.EhSettingView.Title.hostSettings(galleryHost.rawValue)) } // MARK: Form private func form(ehSetting: Binding, ehProfile: Binding) -> some View { @@ -67,12 +70,16 @@ struct EhSettingView: View { deleteAction: { if let value = store.ehProfile?.value { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { - store.send(.performAction(.delete, nil, value)) + store.send( + .performAction(galleryHost: galleryHost, action: .delete, name: nil, set: value) + ) } } }, deleteDialogAction: { store.send(.setNavigation(.deleteProfile)) }, - performEhProfileAction: { store.send(.performAction($0, $1, $2)) } + performEhProfileAction: { + store.send(.performAction(galleryHost: galleryHost, action: $0, name: $1, set: $2)) + } ) ImageLoadSettingsSection(ehSetting: ehSetting) @@ -80,25 +87,25 @@ struct EhSettingView: View { GalleryNameDisplaySection(ehSetting: ehSetting) ArchiverSettingsSection(ehSetting: ehSetting) FrontPageSettingsSection(ehSetting: ehSetting) + OptionalUIElementsSection(ehSetting: ehSetting) FavoritesSection(ehSetting: ehSetting) - RatingsSection(ehSetting: ehSetting) - TagFilteringThresholdSection(ehSetting: ehSetting) - TagWatchingThresholdSection(ehSetting: ehSetting) + SearchResultCountSection(ehSetting: ehSetting) + ThumbnailSettingsSection(ehSetting: ehSetting, galleryHost: galleryHost) } Group { + ThumbnailScalingSection(ehSetting: ehSetting, galleryHost: galleryHost) + RatingsSection(ehSetting: ehSetting) + TagWatchingThresholdSection(ehSetting: ehSetting) + TagFilteringThresholdSection(ehSetting: ehSetting) FilteredRemovalCountSection(ehSetting: ehSetting) ExcludedLanguagesSection(ehSetting: ehSetting) ExcludedUploadersSection(ehSetting: ehSetting) - SearchResultCountSection(ehSetting: ehSetting) - ThumbnailSettingsSection(ehSetting: ehSetting) - ThumbnailScalingSection(ehSetting: ehSetting) ViewportOverrideSection(ehSetting: ehSetting) GalleryCommentsSection(ehSetting: ehSetting) GalleryTagsSection(ehSetting: ehSetting) - GalleryPageNumberingSection(ehSetting: ehSetting) } Group { - OriginalImagesSection(ehSetting: ehSetting) + GalleryPageNumberingSection(ehSetting: ehSetting, galleryHost: galleryHost) MultiplePageViewerSection(ehSetting: ehSetting) } } @@ -117,7 +124,7 @@ struct EhSettingView: View { ToolbarItem(placement: .confirmationAction) { Button { - store.send(.submitChanges) + store.send(.submitChanges(galleryHost: galleryHost)) } label: { Image(systemSymbol: .icloudAndArrowUp) } @@ -286,6 +293,16 @@ private struct ImageSizeSettingsSection: View { } .textCase(nil) + if let useOriginalImagesBinding = Binding($ehSetting.useOriginalImages) { + Section(L10n.Localizable.EhSettingView.Section.Title.originalImages) { + Toggle( + L10n.Localizable.EhSettingView.Title.useOriginalImages, + isOn: useOriginalImagesBinding + ) + } + .textCase(nil) + } + Section(L10n.Localizable.EhSettingView.Description.imageSize) { Text(L10n.Localizable.EhSettingView.Title.imageSize) @@ -369,6 +386,15 @@ private struct FrontPageSettingsSection: View { var body: some View { Section { + CategoryView(bindings: categoryBindings) + } header: { + Text(L10n.Localizable.EhSettingView.Section.Title.frontPageSettings) + .newlineBold() + .appending(L10n.Localizable.EhSettingView.Description.galleryCategory) + } + .textCase(nil) + + Section(L10n.Localizable.EhSettingView.Description.displayMode) { Picker(L10n.Localizable.EhSettingView.Title.displayMode, selection: $ehSetting.displayMode) { ForEach(EhSetting.DisplayMode.allCases) { mode in Text(mode.value) @@ -376,25 +402,37 @@ private struct FrontPageSettingsSection: View { } } .pickerStyle(.menu) - } header: { - Text(L10n.Localizable.EhSettingView.Section.Title.frontPageSettings) - .newlineBold() - .appending(L10n.Localizable.EhSettingView.Description.displayMode) } .textCase(nil) - Section { + Section(L10n.Localizable.EhSettingView.Section.Title.showSearchRangeIndicator) { Toggle( - L10n.Localizable.EhSettingView.Section.Title.showSearchRangeIndicator, + L10n.Localizable.EhSettingView.Title.showSearchRangeIndicator, isOn: $ehSetting.showSearchRangeIndicator ) - } header: { - Text(L10n.Localizable.EhSettingView.Section.Title.showSearchRangeIndicator) } .textCase(nil) + } +} - Section(L10n.Localizable.EhSettingView.Description.galleryCategory) { - CategoryView(bindings: categoryBindings) +// MARK: OptionalUIElementsSection +private struct OptionalUIElementsSection: View { + @Binding private var ehSetting: EhSetting + + init(ehSetting: Binding) { + self._ehSetting = ehSetting + } + + var body: some View { + Section { + Toggle( + L10n.Localizable.EhSettingView.Title.enableGalleryThumbnailSelector, + isOn: $ehSetting.enableGalleryThumbnailSelector + ) + } header: { + Text(L10n.Localizable.EhSettingView.Section.Title.optionalUIElements) + .newlineBold() + .appending(L10n.Localizable.EhSettingView.Description.optionalUIElements) } .textCase(nil) } @@ -543,6 +581,7 @@ private struct FilteredRemovalCountSection: View { Text(L10n.Localizable.EhSettingView.Section.Title.filteredRemovalCount).newlineBold() + Text(L10n.Localizable.EhSettingView.Description.filteredRemovalCount) } + .textCase(nil) } } @@ -712,9 +751,11 @@ private struct SearchResultCountSection: View { // MARK: ThumbnailSettingsSection private struct ThumbnailSettingsSection: View { @Binding private var ehSetting: EhSetting + private let galleryHost: GalleryHost - init(ehSetting: Binding) { - _ehSetting = ehSetting + init(ehSetting: Binding, galleryHost: GalleryHost) { + self._ehSetting = ehSetting + self.galleryHost = galleryHost } var body: some View { @@ -755,11 +796,11 @@ private struct ThumbnailSettingsSection: View { LabeledContent(L10n.Localizable.EhSettingView.Title.thumbnailRowCount) { Picker(selection: $ehSetting.thumbnailConfigRows) { ForEach(ehSetting.capableThumbnailConfigRowCounts) { row in - Text(row.value) + Text(row.value(galleryHost: galleryHost)) .tag(row) } } label: { - Text(ehSetting.capableThumbnailConfigRowCount.value) + Text(ehSetting.capableThumbnailConfigRowCount.value(galleryHost: galleryHost)) } .pickerStyle(.segmented) .frame(width: 200) @@ -772,9 +813,23 @@ private struct ThumbnailSettingsSection: View { // MARK: ThumbnailScalingSection private struct ThumbnailScalingSection: View { @Binding private var ehSetting: EhSetting + private let galleryHost: GalleryHost - init(ehSetting: Binding) { - _ehSetting = ehSetting + init(ehSetting: Binding, galleryHost: GalleryHost) { + self._ehSetting = ehSetting + self.galleryHost = galleryHost + } + + var scalingTitle: String { + galleryHost == .ehentai + ? L10n.Localizable.EhSettingView.Section.Title.thumbnailScaling + : L10n.Localizable.EhSettingView.Section.Title.coverScaling + } + + var scalingFactorDescription: String { + galleryHost == .ehentai + ? L10n.Localizable.EhSettingView.Description.thumbnailScaleFactor + : L10n.Localizable.EhSettingView.Description.coverScaleFactor } var body: some View { @@ -786,9 +841,9 @@ private struct ThumbnailScalingSection: View { unit: "%" ) } header: { - Text(L10n.Localizable.EhSettingView.Section.Title.thumbnailScaling) + Text(scalingTitle) .newlineBold() - .appending(L10n.Localizable.EhSettingView.Description.scaleFactor) + .appending(scalingFactorDescription) } .textCase(nil) } @@ -914,40 +969,35 @@ private struct GalleryTagsSection: View { // MARK: GalleryPageNumberingSection private struct GalleryPageNumberingSection: View { @Binding private var ehSetting: EhSetting + private let galleryHost: GalleryHost - init(ehSetting: Binding) { - _ehSetting = ehSetting + init(ehSetting: Binding, galleryHost: GalleryHost) { + self._ehSetting = ehSetting + self.galleryHost = galleryHost } - var body: some View { - Section(L10n.Localizable.EhSettingView.Section.Title.galleryPageNumbering) { - Toggle( - L10n.Localizable.EhSettingView.Title.showGalleryPageNumbers, - isOn: $ehSetting.galleryShowPageNumbers - ) - } - .textCase(nil) + var sectionTitle: String { + galleryHost == .ehentai + ? L10n.Localizable.EhSettingView.Section.Title.galleryPageNumbering + : L10n.Localizable.EhSettingView.Section.Title.galleryPageThumbnailLabeling } -} - -// MARK: OriginalImagesSection -private struct OriginalImagesSection: View { - @Binding private var ehSetting: EhSetting - - init(ehSetting: Binding) { - _ehSetting = ehSetting + var pickerTitle: String { + galleryHost == .ehentai + ? L10n.Localizable.EhSettingView.Title.showGalleryPageNumbers + : L10n.Localizable.EhSettingView.Title.showLabelBelowGalleryThumbnails } var body: some View { - if let useOriginalImagesBinding = Binding($ehSetting.useOriginalImages) { - Section(L10n.Localizable.EhSettingView.Section.Title.originalImages) { - Toggle( - L10n.Localizable.EhSettingView.Title.useOriginalImages, - isOn: useOriginalImagesBinding - ) + Section(sectionTitle) { + Picker(pickerTitle, selection: $ehSetting.galleryPageNumbering) { + ForEach(ehSetting.capableGalleryPageNumberingOptions(galleryHost: galleryHost)) { behavior in + Text(behavior.value(galleryHost: galleryHost)) + .tag(behavior) + } } - .textCase(nil) + .pickerStyle(.menu) } + .textCase(nil) } } diff --git a/EhPanda/View/Setting/SettingReducer.swift b/EhPanda/View/Setting/SettingReducer.swift index 9ed13e49..144a0e02 100644 --- a/EhPanda/View/Setting/SettingReducer.swift +++ b/EhPanda/View/Setting/SettingReducer.swift @@ -296,7 +296,9 @@ struct SettingReducer { return .none case .createDefaultEhProfile: - return .run(operation: { _ in _ = await EhProfileRequest(action: .create, name: "EhPanda").response() }) + return .run { [galleryHost = state.setting.galleryHost] _ in + _ = await EhProfileRequest(galleryHost: galleryHost, action: .create, name: "EhPanda").response() + } case .fetchIgneous: guard cookieClient.didLogin else { return .none } diff --git a/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html b/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html index ca4bc0f5..d31002db 100644 --- a/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html +++ b/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html @@ -1,9 +1,9 @@ -●PIXIV● HYYT [67227995] - E-Hentai Galleries +[Artist] mks - E-Hentai Galleries - + @@ -13,11 +13,11 @@ - + -

Showing 1 - 40 of 612 images

<1234567...16>
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
Posted on 02 November 2023, 12:27 by:   KEYLUN    PM
Uploader Comment
https://www.pixiv.net/users/67227995

=================================================
每天大量更新/Massive update every day

https://e-hentai.org/uploader/KEYLUN
=========================================================
Q群被炸,轉戰TELEGRAM
(中文限:做種&補種&交流) :https://t.me/+-Pwn49-d7uQxN2M1
Posted on 17 September 2021, 17:52 by:   onlyregistere    PM
[Vote+]   [Vote-]
Score +82
Pretty funny combination of decent art and terrible low res fetish tattoo photo bashing, what a waste. At least most of them come with the base image.
This stuff should come with a tag so it can be filtered.
Posted on 07 October 2021, 15:47 by:   Nikolaios    PM
[Vote+]   [Vote-]
Score +18
bro translate the chinese name i cannot find the author
Posted on 07 October 2021, 16:42 by:   yooooooooooooiooo    PM
[Vote+]   [Vote-]
Score +52
我超,晚晚 不要啊
Posted on 08 October 2021, 03:17 by:   zdb493637495    PM
[Vote+]   [Vote-]
Score +49
我超,乐
Posted on 13 November 2021, 06:24 by:   Severusli    PM
[Vote+]   [Vote-]
Score +161
粉色矮子因为未成年人过不了审核逃过一劫
Posted on 25 November 2021, 23:47 by:   0ld0neEye    PM
[Vote+]   [Vote-]
Score +21
Ahegao, womb tattoo... good to see we've already set the low bar for Shenhe art in the first couple of days.
Posted on 26 November 2021, 15:50 by:   chung~    PM
[Vote+]   [Vote-]
Score +48
黑人花式體操
Posted on 26 November 2021, 16:25 by:   唱跳rap篮球    PM
[Vote+]   [Vote-]
Score +10
尼哥尼哥He
Posted on 05 December 2021, 05:39 by:   Farry01    PM
[Vote+]   [Vote-]
Score +125
楼上的ylg密麻麻石蜡,提出现的人物也算ky是吧,你是不是觉得你会个ky的词就是网络弄潮儿了啊
Posted on 07 December 2021, 02:40 by:   WorkSpend street    PM
[Vote+]   [Vote-]
Score +53
倪哥能不能死啊😅
Posted on 07 December 2021, 18:43 by:   samuelmoon    PM
[Vote+]   [Vote-]
Score +95
黑人就该被灭绝
Posted on 16 December 2021, 13:03 by:   hhhhf123    PM
[Vote+]   [Vote-]
Score +28
qq人:乌鸦座飞机!
Posted on 01 January 2022, 11:29 by:   二苇渡江    PM
[Vote+]   [Vote-]
Score +39
申鹤就应该被黑人隔着裤袜草死
Posted on 08 January 2022, 15:48 by:   雪芬12256    PM
[Vote+]   [Vote-]
Score +51
画技忽高忽低,透视也七上八下....不会是半路出家吧?
Posted on 08 January 2022, 18:23 by:   kevinstu7    PM
[Vote+]   [Vote-]
Score +14
xp巨好,如果画的更好就完美了
Posted on 11 January 2022, 05:18 by:   魔女的丝袜    PM
[Vote+]   [Vote-]
Score +14
感觉更像是哥布林但比哥布林还背德
Posted on 12 January 2022, 08:12 by:   ss407935963    PM
[Vote+]   [Vote-]
Score +5
呃呃呃呃好吧
Last edited on 26 April 2022, 22:11.
Posted on 17 February 2022, 09:05 by:   acgs    PM
[Vote+]   [Vote-]
Score +16
倪哥能不能爬啊😋
Posted on 06 March 2022, 09:06 by:   jmc_akatsuki    PM
[Vote+]   [Vote-]
Score +16
p站找不到这个画师了,是删号了还是炸号了?
Posted on 06 March 2022, 14:36 by:   ShaodowNinja    PM
[Vote+]   [Vote-]
Score +19
删作品加换名,问了下说是没事,我暂且蒙古
Posted on 08 March 2022, 14:50 by:   Stella0119    PM
[Vote+]   [Vote-]
Score +12
我超,以前的画都删了,没那些小作文都没那么色了
Posted on 20 March 2022, 00:04 by:   qingjiangxiangbei    PM
[Vote+]   [Vote-]
Score +13
一只喜爱,作者名字
Posted on 07 April 2022, 06:35 by:   CNx1    PM
[Vote+]   [Vote-]
Score +10
没有爱老师的旁白,图的色度大大下降了。
Posted on 07 April 2022, 19:22 by:   YZZ200219    PM
[Vote+]   [Vote-]
Score +12
这位画师的精髓可是小作文啊,这单图不太行啊
Posted on 18 April 2022, 12:59 by:   fengqing123    PM
[Vote+]   [Vote-]
Score +8
可惜没简介了
Posted on 02 May 2022, 04:59 by:   空明幻想    PM
[Vote+]   [Vote-]
Score +12
这个画师的作品在eh上的排序都是反的 怎么回事
Posted on 11 May 2022, 02:59 by:   Yinjiuzui    PM
[Vote+]   [Vote-]
Score +9
可有人存过珍惜小作文资源?(
Posted on 17 June 2022, 15:53 by:   Edwi17    PM
[Vote+]   [Vote-]
Score +57
尼哥不就是现实题材下的哥布林和兽人吗。。。有什么接受不了的,尼哥这一个设定就有流浪汉的脏乱差有黑帮的毒品有体育老师的体格,再加上大吉吧的刻板印象,拿来当黄毛设定不要太方便(别人的评论)
Posted on 18 June 2022, 09:20 by:   ss407935963    PM
[Vote+]   [Vote-]
Score +91
现实里没有强奸和轮奸吗?为什么你们还要看呢?看个本子因为屁大点事骂到画师删作品加改名。我看有尼哥的本子是媚黑,那如果你看了有违法行为的本子敢不敢去自首??更别提r18g的本子了。有些小鬼是真的恶心,纯低能。
Posted on 06 July 2022, 22:43 by:   gftrym    PM
[Vote+]   [Vote-]
Score +43
这评论区太脑瘫了。
Posted on 19 July 2022, 10:48 by:   hentaisang52    PM
[Vote+]   [Vote-]
Score +12
没文字感觉没味道,每次简介的小作文可是精华啊
Posted on 09 September 2022, 14:39 by:   huifeidehaitun    PM
[Vote+]   [Vote-]
Score +6
原来还有小作文,看了这么多次,都不知道QAQ
Posted on 12 September 2022, 07:29 by:   fanboshi    PM
[Vote+]   [Vote-]
Score +43
整个星球的黑人加起来都不够你们二次元的♠去榨的
Posted on 17 September 2022, 06:29 by:   seedt    PM
[Vote+]   [Vote-]
Score +10
所以说什么时候把留学牲宿舍拆了 把negro,学渣棒那些遣返捏
Posted on 05 May 2023, 14:25 by:   Bakster123    PM
[Vote+]   [Vote-]
Score +15
This artist shows some creativity in camera angles and poses, not too far from the generic ones but enough to catch the eye.

I feel that if they invest more in this, they will gain a foothold at a new level.
Posted on 05 May 2023, 15:19 by:   gunpowderfans    PM
[Vote+]   [Vote-]
Score +6
什么时候画马的
Posted on 05 May 2023, 17:57 by:   shuyuuuuu    PM
[Vote+]   [Vote-]
Score +24
tmd截肢标签放第一个,结果翻了快三百页才看到截肢图😡
Posted on 06 May 2023, 05:02 by:   Nicolasbot    PM
[Vote+]   [Vote-]
Score +7
看个黄图都有种族主义是吧,没出生在德三上前线是不是浑身刺挠?
Posted on 24 May 2023, 07:33 by:   Fuck you?    PM
[Vote+]   [Vote-]
Score +6
雷电将军太戳我啦😍😍
Posted on 31 May 2023, 00:31 by:   白兔糖~    PM
[Vote+]   [Vote-]
Score +6
这个作者现在怎么没有赞助了
Posted on 04 June 2023, 16:12 by:   mooyee    PM
[Vote+]   [Vote-]
Score +13
这个作者画米家烧鸡一直很顶的,尤其是崩三图,别家出高质量崩三r18或者r18g图都很少,就这个作者一直出很顶的图
Posted on 04 June 2023, 16:29 by:   茜色的火焰    PM
[Vote+]   [Vote-]
Score +16
我也歧视黑人 但是这种色图里的黑人我没什么感觉
Posted on 05 June 2023, 04:14 by:   黑色騎士    PM
[Vote+]   [Vote-]
Score +6
我宁肯看尼也不想看散呀,这东西在我这和慎二一个量级的(在色图里看见觉得晦气)
Posted on 05 June 2023, 14:48 by:   eric11825    PM
[Vote+]   [Vote-]
Score +6
強烈建議去P站看作者的小作文
Posted on 25 July 2023, 03:09 by:   yxlm9527    PM
[Vote+]   [Vote-]
Score +19
评论区真是卧龙凤雏,我每次看到这种类型的本子就先点开评论区瞅瞅看有没有人才😆
Posted on 25 July 2023, 09:03 by:   yazawayuan    PM
[Vote+]   [Vote-]
Score +3
这位老师的小作文才是精髓啊
Posted on 02 August 2023, 04:50 by:   ussr_without_⑨    PM
[Vote+]   [Vote-]
Score +11
空哥跟重云这个对比笑死我了
Posted on 02 November 2023, 12:32 by:   cpwt4567    PM
[Vote+]   [Vote-]
Score +4
看到我老婆夜兰像母狗一样被人操就觉得好幸福

There are 19 more comments below the viewing threshold - click to show all.

[Post New Comment]

+

[Artist] mks

[アーティスト] mks

Non-H
Posted:2024-10-27 06:20
Parent:2930572
Visible:Yes
Language:Japanese  
File Size:314.3 MiB
Length:156 pages
Favorited:587 times
Rating:
108
Average: 4.74

Showing 1 - 40 of 156 images

<1234>
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
Posted on 27 October 2024, 06:20 by:   Pokom    PM
Uploader Comment
https://www.pixiv.net/users/750220

https://mks.booth.pm/
https://twitter.com/mks_fStD
Posted on 28 August 2022, 07:32 by:   Roobubba    PM
[Vote+]   [Vote-]
Score +109
Some gorgeous scenery there. Makes a refreshing change to see some good, clean stuff.
Posted on 27 November 2022, 04:02 by:   囧斯诺    PM
[Vote+]   [Vote-]
Score +5
真的美极了
Posted on 14 December 2022, 13:09 by:   siyuaner    PM
[Vote+]   [Vote-]
Score +27
在E站,你甚至可以看风景
Posted on 11 January 2023, 05:28 by:   曾俊华    PM
[Vote+]   [Vote-]
Score +19
谁说E站就只能看那些东西?凡是我们所欣赏的,都可以在这里表达出来
Posted on 11 January 2023, 10:59 by:   ddddecade123    PM
[Vote+]   [Vote-]
Score +9
还有没有画这种的大佬啊,迷上了
Posted on 02 July 2023, 03:23 by:   Akrbear    PM
[Vote+]   [Vote-]
Score +7
真的好漂亮啊
Posted on 02 July 2023, 09:34 by:   犯罪高手    PM
[Vote+]   [Vote-]
Score +12
生活不止眼前的苟且,还有诗和远方
Posted on 26 January 2024, 15:35 by:   HQH1301376128    PM
[Vote+]   [Vote-]
Score +21
想到了小时候放学去同学家打游戏错过时间,在山里骑着自行车回家路过田野的景象,那时候的月亮和星星是真的亮啊,不过有一段路路过坟山还是很怕的
Posted on 27 October 2024, 06:24 by:   黑锋血色    PM
[Vote+]   [Vote-]
Score +7
赛博亚历山大图书馆
- Front -   LoFi   Forums   HentaiVerse   Wiki   Twitter   ToS   Advertise - + Front +   LoFi   Forums   HentaiVerse   Wiki   Twitter   ToS   Advertise +
diff --git a/EhPandaTests/Resources/Parser/Other/EhSetting.html b/EhPandaTests/Resources/Parser/Other/EhSetting.html index c0dc54df..b575cfe4 100644 --- a/EhPandaTests/Resources/Parser/Other/EhSetting.html +++ b/EhPandaTests/Resources/Parser/Other/EhSetting.html @@ -1,10 +1,10 @@ - - + + E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System - + @@ -20,21 +20,7 @@ return false; } - -

-[Overview] -  [My Stats] -  [My Settings] -  [My Tags] -  [Hentai@Home] -  [Donations] -  [Hath Perks] -  [Hath Exchange] -  [GP Exchange] -  [Credit Log] -  [Karma Log] -

- +
@@ -56,6 +42,19 @@
-

Favorites

@@ -254,13 +253,72 @@

Favorites

+
-

You can also select your default sort order for galleries on your favorites page. Note that favorites added prior to the March 2016 revamp did not store a timestamp, and will use the gallery posted time regardless of this setting.

+

Default sort order for galleries on your favorites page:

+ + +

Search Result Count

+ +
+

How many results would you like per page for the index/search page and torrent search pages? (Hath Perk: Paging Enlargement Required)

+
+

+

+

+
+
+ + +

Thumbnail Settings

+ +
+

How would you like the mouse-over thumbnails on the front page to load when using Minimal or Compact display mode?

+
+

+

+
+
+ +
+

You can set a default thumbnail configuration for all galleries you visit.

+
+ + + + + + + + + +
Size: +
+
+
Rows: +
+
+
+
+
+ + +

Thumbnail Scaling

+ +
+ + + + + +
%Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75% and 150%.
+
+

Ratings

@@ -273,6 +331,7 @@

Ratings

+

Tag Watching Threshold

@@ -285,7 +344,6 @@

Tag Watching Threshold

-

Tag Filtering Threshold

@@ -298,7 +356,7 @@

Tag Filtering Threshold

- +

Show Filtered Removal Count

@@ -460,62 +518,6 @@

Excluded Uploaders

You are currently using 0 of 1000 exclusion slots.

- - -

Search Result Count

- -
-

How many results would you like per page for the index/search page and torrent search pages? (Hath Perk: Paging Enlargement Required)

-
-

-

-

-
-
- -

Thumbnail Settings

- -
-

How would you like the mouse-over thumbnails on the front page to load when using List Mode?

-
-

-

-
-
-
-

You can set a default thumbnail configuration for all galleries you visit.

-
- - - - - - - - - -
Size: -
-
-
Rows: -
-
-
-
-
- - -

Thumbnail Scaling

- -
- - - - - -
%Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75% and 150%.
-
-

Viewport Override

@@ -567,16 +569,6 @@

Gallery Page Numbering

- -

Original Images

- -
-

Use original images instead of the resampled versions where available?

-
-

-

-
-

Multi-Page Viewer

@@ -609,6 +601,11 @@

Multi-Page Viewer

+ +
+ Front +   LoFi   Forums   HentaiVerse   Wiki   Twitter   ToS   Advertise +
diff --git a/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift b/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift index 527eddd7..86470902 100644 --- a/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift +++ b/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift @@ -14,27 +14,27 @@ class GalleryDetailParserTests: XCTestCase, TestHelper { let document = try htmlDocument(filename: .galleryDetail) let (detail, state) = try Parser.parseGalleryDetail(doc: document, gid: "2725078") XCTAssertEqual(detail.gid, "2725078") - XCTAssertEqual(detail.title, "●PIXIV● HYYT [67227995]") - XCTAssertEqual(detail.jpnTitle, nil) + XCTAssertEqual(detail.title, "[Artist] mks") + XCTAssertEqual(detail.jpnTitle, "[アーティスト] mks") XCTAssertFalse(detail.isFavorited) XCTAssertEqual(detail.visibility, .yes) XCTAssertEqual(detail.rating, 4.5) XCTAssertEqual(detail.userRating, 0) - XCTAssertEqual(detail.ratingCount, 569) - XCTAssertEqual(detail.category, .imageSet) + XCTAssertEqual(detail.ratingCount, 108) + XCTAssertEqual(detail.category, .nonH) XCTAssertEqual(detail.language, .japanese) - XCTAssertEqual(detail.uploader, "KEYLUN") - XCTAssertEqual(detail.coverURL?.absoluteString, "https://ehgt.org/5e/b5/5eb550886fe58da8c780d9ab9182717ae9bcda91-604248-2235-3016-jpg_250.jpg") - XCTAssertEqual(detail.archiveURL?.absoluteString, "https://e-hentai.org/archiver.php?gid=0000000&token=0000000000&or=471924--76094077f7be1ee86673ef75c45e0d382961dc9c") - XCTAssertEqual(detail.parentURL?.absoluteString, "https://e-hentai.org/g/2624293/78cf5e78a5/") - XCTAssertEqual(detail.favoritedCount, 9218) - XCTAssertEqual(detail.pageCount, 612) - XCTAssertEqual(detail.sizeCount, 657.6) + XCTAssertEqual(detail.uploader, "Pokom") + XCTAssertEqual(detail.coverURL?.absoluteString, "https://ehgt.org/03/08/0308268821e99628b05a19fa54e2fc0fa9ad8f4b-1705560-1012-1470-png_250.jpg") + XCTAssertEqual(detail.archiveURL?.absoluteString, "https://e-hentai.org/archiver.php?gid=3103480&token=0000000000&or=480566--44111f81616a100ccab3d9be8ac8b5adedb5d44e") + XCTAssertEqual(detail.parentURL?.absoluteString, "https://e-hentai.org/g/2930572/daf4b9880d/") + XCTAssertEqual(detail.favoritedCount, 587) + XCTAssertEqual(detail.pageCount, 156) + XCTAssertEqual(detail.sizeCount, 314.3) XCTAssertEqual(detail.sizeType, "MiB") - XCTAssertEqual(detail.torrentCount, 5) - XCTAssertEqual(state.tags.count, 4) + XCTAssertEqual(detail.torrentCount, 1) + XCTAssertEqual(state.tags.count, 1) XCTAssertEqual(state.previewURLs.count, 40) XCTAssertEqual(state.previewConfig, .normal(rows: 4)) - XCTAssertEqual(state.comments.count, 49) + XCTAssertEqual(state.comments.count, 10) } } diff --git a/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift b/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift index 61639d94..b97a2bf2 100644 --- a/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift +++ b/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift @@ -12,7 +12,7 @@ import XCTest class EhSettingParserTests: XCTestCase, TestHelper { func testExample() throws { let document = try htmlDocument(filename: .ehSetting) - let ehSetting = try Parser.parseEhSetting(doc: document) + let ehSetting = try Parser.parseEhSetting(doc: document, galleryHost: .ehentai) testEhProfiles(ehSetting.ehProfiles) testCapability(ehSetting: ehSetting) testRemainingStuff(ehSetting: ehSetting) @@ -45,8 +45,8 @@ class EhSettingParserTests: XCTestCase, TestHelper { XCTAssertEqual(ehSetting.capableSearchResultCount, .oneHundred) XCTAssertEqual(ehSetting.capableSearchResultCounts, [.twentyFive, .fifty, .oneHundred]) - XCTAssertEqual(ehSetting.capableThumbnailConfigSize, .large) - XCTAssertEqual(ehSetting.capableThumbnailConfigSizes, EhSetting.ThumbnailSize.allCases) + XCTAssertEqual(ehSetting.thumbnailConfigSize, .normal) + XCTAssertEqual(ehSetting.capableThumbnailConfigSizes, [.normal, .large]) XCTAssertEqual(ehSetting.capableThumbnailConfigRowCount, .forty) XCTAssertEqual(ehSetting.capableThumbnailConfigRowCounts, EhSetting.ThumbnailRowCount.allCases) @@ -75,16 +75,16 @@ class EhSettingParserTests: XCTestCase, TestHelper { XCTAssertEqual(ehSetting.showFilteredRemovalCount, true) XCTAssertEqual(ehSetting.excludedLanguages, .init(repeating: false, count: 50)) XCTAssertEqual(ehSetting.excludedUploaders, "") - XCTAssertEqual(ehSetting.searchResultCount, .twentyFive) + XCTAssertEqual(ehSetting.searchResultCount, .oneHundred) XCTAssertEqual(ehSetting.thumbnailLoadTiming, .onMouseOver) - XCTAssertEqual(ehSetting.thumbnailConfigSize, .large) + XCTAssertEqual(ehSetting.thumbnailConfigSize, .normal) XCTAssertEqual(ehSetting.thumbnailConfigRows, .four) XCTAssertEqual(ehSetting.thumbnailScaleFactor, 100) XCTAssertEqual(ehSetting.viewportVirtualWidth, 0) XCTAssertEqual(ehSetting.commentsSortOrder, .oldest) XCTAssertEqual(ehSetting.commentVotesShowTiming, .onHoverOrClick) XCTAssertEqual(ehSetting.tagsSortOrder, .alphabetical) - XCTAssertEqual(ehSetting.galleryShowPageNumbers, false) + XCTAssertEqual(ehSetting.galleryPageNumbering, .none) XCTAssertEqual(ehSetting.useOriginalImages, false) XCTAssertEqual(ehSetting.useMultiplePageViewer, true) XCTAssertEqual(ehSetting.multiplePageViewerStyle, .alignLeftScaleIfOverWidth)