diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 690497a3..c6728479 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,7 +6,7 @@ on: types: [closed] env: DEVELOPER_DIR: /Applications/Xcode_16.0.app - APP_VERSION: '2.7.6' + APP_VERSION: '2.7.7' SCHEME_NAME: 'EhPanda' ALTSTORE_JSON_PATH: './AltStore.json' BUILDS_PATH: '/tmp/action-builds' diff --git a/EhPanda/App/Generated/Strings.swift b/EhPanda/App/Generated/Strings.swift index 83049af2..6a53a373 100644 --- a/EhPanda/App/Generated/Strings.swift +++ b/EhPanda/App/Generated/Strings.swift @@ -528,8 +528,6 @@ 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.") } @@ -557,8 +555,6 @@ internal enum L10n { internal static let galleryComments = L10n.tr("Localizable", "eh_setting_view.section.title.gallery_comments", fallback: "Gallery Comments") /// Gallery Name Display 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 @@ -587,8 +583,6 @@ internal enum L10n { internal static let tagFilteringThreshold = L10n.tr("Localizable", "eh_setting_view.section.title.tag_filtering_threshold", fallback: "Tag Filtering Threshold") /// Tag Watching Threshold internal static let tagWatchingThreshold = L10n.tr("Localizable", "eh_setting_view.section.title.tag_watching_threshold", fallback: "Tag Watching Threshold") - /// Thumbnail Scaling - internal static let thumbnailScaling = L10n.tr("Localizable", "eh_setting_view.section.title.thumbnail_scaling", fallback: "Thumbnail Scaling") /// Thumbnail Settings internal static let thumbnailSettings = L10n.tr("Localizable", "eh_setting_view.section.title.thumbnail_settings", fallback: "Thumbnail Settings") /// Viewport Override @@ -638,8 +632,6 @@ internal enum L10n { internal static let selectedProfile = L10n.tr("Localizable", "eh_setting_view.title.selected_profile", fallback: "Selected profile") /// Show filtered removal count 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 @@ -1329,16 +1321,12 @@ internal enum L10n { } 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 { diff --git a/EhPanda/App/Tools/Clients/UIApplicationClient.swift b/EhPanda/App/Tools/Clients/UIApplicationClient.swift index 9683bb5c..13846577 100644 --- a/EhPanda/App/Tools/Clients/UIApplicationClient.swift +++ b/EhPanda/App/Tools/Clients/UIApplicationClient.swift @@ -11,7 +11,7 @@ import ComposableArchitecture struct UIApplicationClient { let openURL: @MainActor (URL) -> Void - let hideKeyboard: () -> Void + let hideKeyboard: @Sendable () async -> Void let alternateIconName: () -> String? let setAlternateIconName: @MainActor (String?) async -> Bool let setUserInterfaceStyle: @MainActor (UIUserInterfaceStyle) -> Void @@ -23,7 +23,9 @@ extension UIApplicationClient { UIApplication.shared.open(url, options: [:]) }, hideKeyboard: { - UIApplication.shared.endEditing() + await MainActor.run { + UIApplication.shared.endEditing() + } }, alternateIconName: { UIApplication.shared.alternateIconName diff --git a/EhPanda/App/Tools/Extensions/Extensions.swift b/EhPanda/App/Tools/Extensions/Extensions.swift index b82d300d..a837f9a2 100644 --- a/EhPanda/App/Tools/Extensions/Extensions.swift +++ b/EhPanda/App/Tools/Extensions/Extensions.swift @@ -17,6 +17,7 @@ extension Encodable { // MARK: UIApplication extension UIApplication { + @MainActor func endEditing() { sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) } diff --git a/EhPanda/App/Tools/Parser.swift b/EhPanda/App/Tools/Parser.swift index 7e2d367b..6220e3d5 100644 --- a/EhPanda/App/Tools/Parser.swift +++ b/EhPanda/App/Tools/Parser.swift @@ -318,41 +318,17 @@ struct Parser { let singlePageCount = Int(gpcText[rangeA.upperBound.. URL { @@ -594,57 +570,42 @@ struct Parser { // MARK: Preview static func parsePreviewURLs(doc: HTMLDocument) throws -> [Int: URL] { - func parseNormalPreviewURLs(node: XMLElement) -> [Int: URL] { + func parseGT100PreviewURLs(node: XMLElement) -> [Int: URL] { var previewURLs = [Int: URL]() - for link in node.xpath("//div") where link.className == nil { - guard let imgLink = link.at_xpath("//img"), - let index = Int(imgLink["alt"] ?? ""), - let linkStyle = link["style"], - let rangeA = linkStyle.range(of: "width:"), - let rangeB = linkStyle.range(of: "px; height:"), - let rangeC = linkStyle.range(of: "px; background"), - let rangeD = linkStyle.range(of: "url("), - let rangeE = linkStyle.range(of: ") -") - else { continue } - - let remainingText = linkStyle[rangeE.upperBound...] - guard let rangeF = remainingText.range(of: "px ") - else { continue } - - let width = linkStyle[rangeA.upperBound.. [Int: URL] { - var previewURLs = [Int: URL]() - - for link in node.xpath("//img") { - guard let index = Int(link["alt"] ?? ""), - let urlString = link["src"], !urlString.contains("blank.gif"), - let url = URL(string: urlString) - else { continue } + for link in node.xpath("//a") { + if let divNode = link.at_xpath(".//div[@title and @style]"), + let style = divNode["style"], + let rangeA = style.range(of: "width:"), + let rangeB = style.range(of: "px;height:"), + let rangeC = style.range(of: "px;background"), + let rangeD = style.range(of: "url("), + let rangeE = style.range(of: ") -"), + let rangeF = style[rangeE.upperBound...].range(of: "px "), + let urlString = style[rangeD.upperBound.. [Int: URL] { var previewURLs = [Int: URL]() for link in node.xpath("//a") { - if let divNode = link.at_xpath("div"), + if let divNode = link.at_xpath(".//div[@title and @style]"), let style = divNode["style"], let rangeA = style.range(of: "url("), let rangeB = style.range(of: ")"), @@ -653,7 +614,7 @@ struct Parser { .addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed), let url = URL(string: urlString), let title = divNode["title"], - let index = parseGT200IndexFromTitle(from: title) + let index = parseGTX00IndexFromTitle(from: title) { previewURLs[index] = url } @@ -666,8 +627,7 @@ struct Parser { else { throw AppError.parseFailed } return switch previewMode { - case "gdtl": parseLargePreviewURLs(node: gdtNode) - case "gdtm": parseNormalPreviewURLs(node: gdtNode) + case "gt100": parseGT100PreviewURLs(node: gdtNode) case "gt200": parseGT200PreviewURLs(node: gdtNode) default: .init() } @@ -745,7 +705,7 @@ struct Parser { return comments } - static func parseGT200IndexFromTitle(from title: String) -> Int? { + static func parseGTX00IndexFromTitle(from title: String) -> Int? { // The probable format of page title is "Page [Number]: filename" ( title @@ -765,13 +725,13 @@ struct Parser { let previewMode = try? parsePreviewMode(doc: doc) else { throw AppError.parseFailed } - if previewMode == "gt200" { + if ["gt100", "gt200"].contains(previewMode) { for aLink in gdtNode.xpath("a") { guard let href = aLink["href"], let thumbnailURL = URL(string: href), - let divNode = aLink.at_xpath("div"), + let divNode = aLink.at_xpath(".//div[@title and @style]"), let title = divNode["title"], - let index = parseGT200IndexFromTitle(from: title) + let index = parseGTX00IndexFromTitle(from: title) else { continue } thumbnailURLs[index] = thumbnailURL @@ -813,10 +773,8 @@ struct Parser { } static func parsePreviewMode(doc: HTMLDocument) throws -> String { - if doc.at_xpath("//div [@class='gdtm']") != nil { - return "gdtm" - } else if doc.at_xpath("//div [@class='gdtl']") != nil { - return "gdtl" + if doc.at_xpath("//div [@class='gt100']") != nil { + return "gt100" } else if doc.at_xpath("//div [@class='gt200']") != nil { return "gt200" } else { @@ -1108,7 +1066,7 @@ extension Parser { } // MARK: EhSetting - static func parseEhSetting(doc: HTMLDocument, galleryHost: GalleryHost) throws -> EhSetting { + static func parseEhSetting(doc: HTMLDocument) throws -> EhSetting { func parseInt(node: XMLElement, name: String) -> Int? { var value: Int? for link in node.xpath("//input [@name='\(name)']") @@ -1182,7 +1140,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 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? + 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 coverScaleFactor: 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") @@ -1296,12 +1254,10 @@ extension Parser { } } 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 + switch $0 { + case 0: .auto + case 1: .normal + case 2: .small default: nil } } @@ -1319,8 +1275,8 @@ extension Parser { capableThumbnailConfigRowCount = parseCapability(node: optouter, name: "tr") } if optouter.at_xpath("//input [@name='tp']") != nil { - thumbnailScaleFactor = Float(parseString(node: optouter, name: "tp") ?? "100") - if thumbnailScaleFactor == nil { thumbnailScaleFactor = 100 } + coverScaleFactor = Float(parseString(node: optouter, name: "tp") ?? "100") + if coverScaleFactor == nil { coverScaleFactor = 100 } } if optouter.at_xpath("//input [@name='vp']") != nil { viewportVirtualWidth = Float(parseString(node: optouter, name: "vp") ?? "0") @@ -1353,10 +1309,10 @@ extension Parser { } // swiftlint:disable line_length - 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 + 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 coverScaleFactor, 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, 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 + 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, coverScaleFactor: coverScaleFactor, 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/Tools/Utilities/URLUtil.swift b/EhPanda/App/Tools/Utilities/URLUtil.swift index 583529f5..98d40b3b 100644 --- a/EhPanda/App/Tools/Utilities/URLUtil.swift +++ b/EhPanda/App/Tools/Utilities/URLUtil.swift @@ -124,7 +124,7 @@ struct URLUtil { url.appending(queryItems: [.letterP: String(pageNum)]) } - static func normalPreviewURL(plainURL: URL, width: String, height: String, offset: String) -> URL { + static func combinedPreviewURL(plainURL: URL, width: String, height: String, offset: String) -> URL { plainURL.appending(queryItems: [.ehpandaWidth: width, .ehpandaHeight: height, .ehpandaOffset: offset]) } diff --git a/EhPanda/App/de.lproj/Localizable.strings b/EhPanda/App/de.lproj/Localizable.strings index 3914fd7e..a3c104a6 100644 --- a/EhPanda/App/de.lproj/Localizable.strings +++ b/EhPanda/App/de.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.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"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "Alphabetical"; "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"; @@ -565,8 +561,6 @@ "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/Localizable.strings b/EhPanda/App/en.lproj/Localizable.strings index ad45a911..002c5f9f 100644 --- a/EhPanda/App/en.lproj/Localizable.strings +++ b/EhPanda/App/en.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.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"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "Alphabetical"; "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"; @@ -565,8 +561,6 @@ "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 3df53ff1..3d5a6d5f 100644 --- a/EhPanda/App/ja.lproj/Localizable.strings +++ b/EhPanda/App/ja.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.thumbnail_scale_factor" = "サムネイル・拡張表示モードでのサムネイルを 75%% ~ 150%% のカスタム値にスケールすることができます。"; "eh_setting_view.description.cover_scale_factor" = "サムネイル・拡張表示モードでのカバーを 75%% ~ 150%% にスケールすることができます。"; "eh_setting_view.section.title.viewport_override" = "表示領域オーバーライド"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "アルファベット順"; "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 ローカルネットワークホスト"; @@ -565,8 +561,6 @@ "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 76aa3714..c2b9c8a7 100644 --- a/EhPanda/App/ko.lproj/Localizable.strings +++ b/EhPanda/App/ko.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.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" = "뷰포트 조정"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "알파벳순으로"; "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 로컬 네트워크 호스트"; @@ -565,8 +561,6 @@ "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 79dde9b3..6f35ae88 100644 --- a/EhPanda/App/zh-Hans.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hans.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.thumbnail_scale_factor" = "缩略图和扩展模式下的画廊列表缩略图可以缩放为 75%% 到 150%% 之间的自定义值。"; "eh_setting_view.description.cover_scale_factor" = "缩略图和扩展模式下的画廊列表封面可以缩放为 75%% 到 150%% 之间的值。"; "eh_setting_view.section.title.viewport_override" = "覆写可视区域"; @@ -541,16 +539,14 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "按字母排序"; "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" = "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.section.title.original_images" = "是否使用原始图像而非重新采样的版本?如果您在上方选择的水平分辨率不是“自动”,并且所查看的图像更宽,或者原始图像大于 10 MiB(对于超过一年的图库,则为 4 MiB),那么仍将使用重新采样的图像。"; "eh_setting_view.title.use_original_images" = "显示原图"; "eh_setting_view.section.title.multi_page_viewer" = "多页查看器"; @@ -565,8 +561,6 @@ "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 17aaac61..a0b80a1f 100644 --- a/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant-HK.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.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"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "Alphabetical"; "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"; @@ -565,8 +561,6 @@ "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 5cb5c7f6..fadf4a3e 100644 --- a/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant-TW.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.thumbnail_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.description.cover_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,封面的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.section.title.viewport_override" = "視窗覆蓋"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "字母順序"; "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)"; @@ -565,8 +561,6 @@ "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 a7ceb359..b3eea87e 100644 --- a/EhPanda/App/zh-Hant.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant.lproj/Localizable.strings @@ -514,10 +514,8 @@ "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.thumbnail_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,縮圖的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.description.cover_scale_factor" = "在縮圖與放大檢視這兩種檢視模式下,封面的重新採樣比率介於 75%% 至 150%%."; "eh_setting_view.section.title.viewport_override" = "視窗覆蓋"; @@ -541,9 +539,7 @@ "enum.eh_setting.tags_sort_order.value.alphabetical" = "字母順序"; "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)"; @@ -565,8 +561,6 @@ "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 e1420218..1e7c81ab 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, 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) + 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, coverScaleFactor: 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 @@ -58,9 +58,6 @@ struct EhSetting: Equatable { 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 } @@ -89,7 +86,7 @@ struct EhSetting: Equatable { var thumbnailLoadTiming: ThumbnailLoadTiming var thumbnailConfigSize: ThumbnailSize var thumbnailConfigRows: ThumbnailRowCount - var thumbnailScaleFactor: Float + var coverScaleFactor: Float var viewportVirtualWidth: Float var commentsSortOrder: CommentsSortOrder var commentVotesShowTiming: CommentVotesShowTiming @@ -174,6 +171,7 @@ extension EhSetting { enum ImageResolution: Int, CaseIterable, Identifiable, Comparable { case auto case x780 + /// Deprecated case x980 case x1280 case x1600 @@ -391,6 +389,7 @@ extension EhSetting { case auto case small case normal + /// Deprecated case large } } @@ -429,10 +428,10 @@ extension EhSetting.ThumbnailRowCount { lhs.rawValue < rhs.rawValue } - func value(galleryHost: GalleryHost) -> String { + var value: String { switch self { case .four: "4" - case .ten: galleryHost == .ehentai ? "10" : "8" + case .ten: "8" case .twenty: "20" case .forty: "40" } @@ -536,20 +535,11 @@ extension EhSetting { extension EhSetting.GalleryPageNumbering { var id: Int { rawValue } - func value(galleryHost: GalleryHost) -> String { + var value: 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 + case .none: L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.none + case .pageNumberOnly: L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.pageNumberOnly + case .pageNumberAndName: L10n.Localizable.Enum.EhSetting.GalleryPageNumbering.Value.pageNumberAndName } } } diff --git a/EhPanda/Network/Request.swift b/EhPanda/Network/Request.swift index 9c0f37cb..d2f06895 100644 --- a/EhPanda/Network/Request.swift +++ b/EhPanda/Network/Request.swift @@ -751,7 +751,6 @@ struct VerifyEhProfileRequest: Request { } struct EhProfileRequest: Request { - let galleryHost: GalleryHost var action: EhProfileAction? var name: String? var set: Int? @@ -777,27 +776,24 @@ struct EhProfileRequest: Request { return URLSession.shared.dataTaskPublisher(for: request) .genericRetry() .tryMap { try Kanna.HTML(html: $0.data, encoding: .utf8) } - .tryMap({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) + .tryMap(Parser.parseEhSetting) .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({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) + .tryMap(Parser.parseEhSetting) .mapError(mapAppError) .eraseToAnyPublisher() } } struct SubmitEhSettingChangesRequest: Request { - let galleryHost: GalleryHost let ehSetting: EhSetting var publisher: AnyPublisher { @@ -821,7 +817,7 @@ struct SubmitEhSettingChangesRequest: Request { "rc": String(ehSetting.searchResultCount.rawValue), "lt": String(ehSetting.thumbnailLoadTiming.rawValue), "tr": String(ehSetting.thumbnailConfigRows.rawValue), - "tp": String(Int(ehSetting.thumbnailScaleFactor)), + "tp": String(Int(ehSetting.coverScaleFactor)), "vp": String(Int(ehSetting.viewportVirtualWidth)), "cs": String(ehSetting.commentsSortOrder.rawValue), "sc": String(ehSetting.commentVotesShowTiming.rawValue), @@ -834,12 +830,10 @@ struct SubmitEhSettingChangesRequest: Request { 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" + switch ehSetting.thumbnailConfigSize { + case .auto: params["ts"] = "0" + case .normal: params["ts"] = "1" + case .small: params["ts"] = "2" default: break } @@ -876,7 +870,7 @@ struct SubmitEhSettingChangesRequest: Request { return URLSession.shared.dataTaskPublisher(for: request) .genericRetry() .tryMap { try Kanna.HTML(html: $0.data, encoding: .utf8) } - .tryMap({ try Parser.parseEhSetting(doc: $0, galleryHost: galleryHost) }) + .tryMap(Parser.parseEhSetting) .mapError(mapAppError) .eraseToAnyPublisher() } diff --git a/EhPanda/View/Detail/Previews/PreviewsView.swift b/EhPanda/View/Detail/Previews/PreviewsView.swift index a2221e43..ec45446d 100644 --- a/EhPanda/View/Detail/Previews/PreviewsView.swift +++ b/EhPanda/View/Detail/Previews/PreviewsView.swift @@ -55,7 +55,7 @@ struct PreviewsView: View { } .onAppear { if store.databaseLoadingState != .loading - && store.previewURLs[index] == nil && (index - 1) % 20 == 0 + && store.previewURLs[index] == nil && (index - 1) % 10 == 0 { store.send(.fetchPreviewURLs(index)) } diff --git a/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift b/EhPanda/View/Setting/EhSetting/EhSettingReducer.swift index d403625b..0a37e613 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(galleryHost: GalleryHost) + case fetchEhSetting case fetchEhSettingDone(Result) - case submitChanges(galleryHost: GalleryHost) + case submitChanges case submitChangesDone(Result) - case performAction(galleryHost: GalleryHost, action: EhProfileAction?, name: String?, set: Int) + case performAction(action: EhProfileAction?, name: String?, set: Int) case performActionDone(Result) } @@ -70,7 +70,7 @@ struct EhSettingReducer { return .none case .setKeyboardHidden: - return .run(operation: { _ in uiApplicationClient.hideKeyboard() }) + return .run(operation: { _ in await uiApplicationClient.hideKeyboard() }) case .setDefaultProfile(let profileSet): return .run { _ in @@ -82,11 +82,11 @@ struct EhSettingReducer { case .teardown: return .merge(CancelID.allCases.map(Effect.cancel(id:))) - case .fetchEhSetting(let galleryHost): + case .fetchEhSetting: guard state.loadingState != .loading else { return .none } state.loadingState = .loading return .run { send in - let response = await EhSettingRequest(galleryHost: galleryHost).response() + let response = await EhSettingRequest().response() await send(.fetchEhSettingDone(response)) } .cancellable(id: CancelID.fetchEhSetting) @@ -102,17 +102,14 @@ struct EhSettingReducer { } return .none - case .submitChanges(let galleryHost): + case .submitChanges: guard state.submittingState != .loading, let ehSetting = state.ehSetting else { return .none } state.submittingState = .loading return .run { send in - let response = await SubmitEhSettingChangesRequest( - galleryHost: galleryHost, ehSetting: ehSetting - ) - .response() + let response = await SubmitEhSettingChangesRequest(ehSetting: ehSetting).response() await send(.submitChangesDone(response)) } .cancellable(id: CancelID.submitChanges) @@ -128,14 +125,11 @@ struct EhSettingReducer { } return .none - case .performAction(let galleryHost, let action, let name, let set): + case .performAction(let action, let name, let set): guard state.submittingState != .loading else { return .none } state.submittingState = .loading return .run { send in - let response = await EhProfileRequest( - galleryHost: galleryHost, action: action, name: name, set: set - ) - .response() + let response = await EhProfileRequest(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 d149199b..27c953a4 100644 --- a/EhPanda/View/Setting/EhSetting/EhSettingView.swift +++ b/EhPanda/View/Setting/EhSetting/EhSettingView.swift @@ -30,7 +30,7 @@ struct EhSettingView: View { LoadingView() .tint(nil) } else if case .failed(let error) = store.loadingState { - ErrorView(error: error, action: { store.send(.fetchEhSetting(galleryHost: galleryHost)) }) + ErrorView(error: error, action: { store.send(.fetchEhSetting) }) .tint(nil) } // Using `Binding.init` will crash the app @@ -43,7 +43,7 @@ struct EhSettingView: View { } .onAppear { if store.ehSetting == nil { - store.send(.fetchEhSetting(galleryHost: galleryHost)) + store.send(.fetchEhSetting) } } .onDisappear { @@ -70,16 +70,12 @@ struct EhSettingView: View { deleteAction: { if let value = store.ehProfile?.value { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { - store.send( - .performAction(galleryHost: galleryHost, action: .delete, name: nil, set: value) - ) + store.send(.performAction(action: .delete, name: nil, set: value)) } } }, deleteDialogAction: { store.send(.setNavigation(.deleteProfile)) }, - performEhProfileAction: { - store.send(.performAction(galleryHost: galleryHost, action: $0, name: $1, set: $2)) - } + performEhProfileAction: { store.send(.performAction(action: $0, name: $1, set: $2)) } ) ImageLoadSettingsSection(ehSetting: ehSetting) @@ -90,10 +86,10 @@ struct EhSettingView: View { OptionalUIElementsSection(ehSetting: ehSetting) FavoritesSection(ehSetting: ehSetting) SearchResultCountSection(ehSetting: ehSetting) - ThumbnailSettingsSection(ehSetting: ehSetting, galleryHost: galleryHost) + ThumbnailSettingsSection(ehSetting: ehSetting) } Group { - ThumbnailScalingSection(ehSetting: ehSetting, galleryHost: galleryHost) + CoverScalingSection(ehSetting: ehSetting) RatingsSection(ehSetting: ehSetting) TagWatchingThresholdSection(ehSetting: ehSetting) TagFilteringThresholdSection(ehSetting: ehSetting) @@ -105,7 +101,7 @@ struct EhSettingView: View { GalleryTagsSection(ehSetting: ehSetting) } Group { - GalleryPageNumberingSection(ehSetting: ehSetting, galleryHost: galleryHost) + GalleryPageThumbnailLabelingSection(ehSetting: ehSetting) MultiplePageViewerSection(ehSetting: ehSetting) } } @@ -124,7 +120,7 @@ struct EhSettingView: View { ToolbarItem(placement: .confirmationAction) { Button { - store.send(.submitChanges(galleryHost: galleryHost)) + store.send(.submitChanges) } label: { Image(systemSymbol: .icloudAndArrowUp) } @@ -751,11 +747,9 @@ private struct SearchResultCountSection: View { // MARK: ThumbnailSettingsSection private struct ThumbnailSettingsSection: View { @Binding private var ehSetting: EhSetting - private let galleryHost: GalleryHost - init(ehSetting: Binding, galleryHost: GalleryHost) { + init(ehSetting: Binding) { self._ehSetting = ehSetting - self.galleryHost = galleryHost } var body: some View { @@ -796,11 +790,11 @@ private struct ThumbnailSettingsSection: View { LabeledContent(L10n.Localizable.EhSettingView.Title.thumbnailRowCount) { Picker(selection: $ehSetting.thumbnailConfigRows) { ForEach(ehSetting.capableThumbnailConfigRowCounts) { row in - Text(row.value(galleryHost: galleryHost)) + Text(row.value) .tag(row) } } label: { - Text(ehSetting.capableThumbnailConfigRowCount.value(galleryHost: galleryHost)) + Text(ehSetting.capableThumbnailConfigRowCount.value) } .pickerStyle(.segmented) .frame(width: 200) @@ -810,40 +804,26 @@ private struct ThumbnailSettingsSection: View { } } -// MARK: ThumbnailScalingSection -private struct ThumbnailScalingSection: View { +// MARK: CoverScalingSection +private struct CoverScalingSection: View { @Binding private var ehSetting: EhSetting - private let galleryHost: GalleryHost - init(ehSetting: Binding, galleryHost: GalleryHost) { + init(ehSetting: Binding) { 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 { Section { ValuePicker( title: L10n.Localizable.EhSettingView.Title.scaleFactor, - value: $ehSetting.thumbnailScaleFactor, + value: $ehSetting.coverScaleFactor, range: 75...150, unit: "%" ) } header: { - Text(scalingTitle) + Text(L10n.Localizable.EhSettingView.Section.Title.coverScaling) .newlineBold() - .appending(scalingFactorDescription) + .appending(L10n.Localizable.EhSettingView.Description.coverScaleFactor) } .textCase(nil) } @@ -966,32 +946,22 @@ private struct GalleryTagsSection: View { } } -// MARK: GalleryPageNumberingSection -private struct GalleryPageNumberingSection: View { +// MARK: GalleryPageThumbnailLabelingSection +private struct GalleryPageThumbnailLabelingSection: View { @Binding private var ehSetting: EhSetting - private let galleryHost: GalleryHost - init(ehSetting: Binding, galleryHost: GalleryHost) { + init(ehSetting: Binding) { self._ehSetting = ehSetting - self.galleryHost = galleryHost - } - - var sectionTitle: String { - galleryHost == .ehentai - ? L10n.Localizable.EhSettingView.Section.Title.galleryPageNumbering - : L10n.Localizable.EhSettingView.Section.Title.galleryPageThumbnailLabeling - } - var pickerTitle: String { - galleryHost == .ehentai - ? L10n.Localizable.EhSettingView.Title.showGalleryPageNumbers - : L10n.Localizable.EhSettingView.Title.showLabelBelowGalleryThumbnails } var body: some View { - Section(sectionTitle) { - Picker(pickerTitle, selection: $ehSetting.galleryPageNumbering) { - ForEach(ehSetting.capableGalleryPageNumberingOptions(galleryHost: galleryHost)) { behavior in - Text(behavior.value(galleryHost: galleryHost)) + Section(L10n.Localizable.EhSettingView.Section.Title.galleryPageThumbnailLabeling) { + Picker( + L10n.Localizable.EhSettingView.Title.showLabelBelowGalleryThumbnails, + selection: $ehSetting.galleryPageNumbering + ) { + ForEach(EhSetting.GalleryPageNumbering.allCases) { behavior in + Text(behavior.value) .tag(behavior) } } diff --git a/EhPanda/View/Setting/SettingReducer.swift b/EhPanda/View/Setting/SettingReducer.swift index 144a0e02..7fc0c0e2 100644 --- a/EhPanda/View/Setting/SettingReducer.swift +++ b/EhPanda/View/Setting/SettingReducer.swift @@ -296,8 +296,8 @@ struct SettingReducer { return .none case .createDefaultEhProfile: - return .run { [galleryHost = state.setting.galleryHost] _ in - _ = await EhProfileRequest(galleryHost: galleryHost, action: .create, name: "EhPanda").response() + return .run { _ in + _ = await EhProfileRequest(action: .create, name: "EhPanda").response() } case .fetchIgneous: diff --git a/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html b/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html index d31002db..35b5bb75 100644 --- a/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html +++ b/EhPandaTests/Resources/Parser/Gallery/GalleryDetail.html @@ -2,7 +2,7 @@ [Artist] mks - E-Hentai Galleries - + @@ -32,15 +32,14 @@ function pop_fav(){return popUp(popbase+"addfav",675,415);} function pop_ren(){return popUp(popbase+"rename",675,415);} - -

[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
赛博亚历山大图书馆
+ +

[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:591 times
Rating:
110
Average: 4.74

Showing 1 - 40 of 156 images

<1234>
40
80
200
400
100x
200x
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 +113
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 diff --git a/EhPandaTests/Resources/Parser/Other/EhSetting.html b/EhPandaTests/Resources/Parser/Other/EhSetting.html index b575cfe4..72f8aeba 100644 --- a/EhPandaTests/Resources/Parser/Other/EhSetting.html +++ b/EhPandaTests/Resources/Parser/Other/EhSetting.html @@ -2,9 +2,9 @@ E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System - + @@ -116,10 +116,10 @@

Image Size Settings

Images are normally resampled to 1280 pixels (desktop) or 780 pixels (mobile) horizontal resolution for online viewing. You can select one of the following alternative resolutions.

-
-
-
+
+
+
@@ -202,7 +202,7 @@

Front Page / Search Settings

Optional UI Elements

-

Some historic UI elements are now disabled by default. You can enable those here.

+

Some historic UI elements are now disabled by default. You can enable those here.

@@ -292,14 +292,14 @@

Thumbnail Settings

Size: -
+
Rows: -
+
@@ -308,13 +308,13 @@

Thumbnail Settings

-

Thumbnail Scaling

+

Cover Scaling

- +
%Thumbnails on the thumbnail and extended gallery list views can be scaled to a custom value between 75% and 150%.The cover size in gallery list views can be scaled to between 75% and 150% when using the Thumbnail or Extended display modes.
@@ -560,13 +560,14 @@

Gallery Tags

-

Gallery Page Numbering

+

Gallery Page Thumbnail Labeling

-

Show gallery page numbers: +

Show label below gallery thumbnails:

-

-

+

+

+

diff --git a/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift b/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift index 86470902..dbb029aa 100644 --- a/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift +++ b/EhPandaTests/Tests/Parser/Gallery/GalleryDetailParserTests.swift @@ -20,14 +20,14 @@ class GalleryDetailParserTests: XCTestCase, TestHelper { XCTAssertEqual(detail.visibility, .yes) XCTAssertEqual(detail.rating, 4.5) XCTAssertEqual(detail.userRating, 0) - XCTAssertEqual(detail.ratingCount, 108) + XCTAssertEqual(detail.ratingCount, 110) XCTAssertEqual(detail.category, .nonH) XCTAssertEqual(detail.language, .japanese) 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.archiveURL?.absoluteString, "https://e-hentai.org/archiver.php?gid=3103480&token=0000000000") XCTAssertEqual(detail.parentURL?.absoluteString, "https://e-hentai.org/g/2930572/daf4b9880d/") - XCTAssertEqual(detail.favoritedCount, 587) + XCTAssertEqual(detail.favoritedCount, 591) XCTAssertEqual(detail.pageCount, 156) XCTAssertEqual(detail.sizeCount, 314.3) XCTAssertEqual(detail.sizeType, "MiB") diff --git a/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift b/EhPandaTests/Tests/Parser/Other/EhSettingParserTests.swift index b97a2bf2..072e1cd5 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, galleryHost: .ehentai) + let ehSetting = try Parser.parseEhSetting(doc: document) testEhProfiles(ehSetting.ehProfiles) testCapability(ehSetting: ehSetting) testRemainingStuff(ehSetting: ehSetting) @@ -45,8 +45,7 @@ class EhSettingParserTests: XCTestCase, TestHelper { XCTAssertEqual(ehSetting.capableSearchResultCount, .oneHundred) XCTAssertEqual(ehSetting.capableSearchResultCounts, [.twentyFive, .fifty, .oneHundred]) - XCTAssertEqual(ehSetting.thumbnailConfigSize, .normal) - XCTAssertEqual(ehSetting.capableThumbnailConfigSizes, [.normal, .large]) + XCTAssertEqual(ehSetting.capableThumbnailConfigSizes, [.auto, .small, .normal]) XCTAssertEqual(ehSetting.capableThumbnailConfigRowCount, .forty) XCTAssertEqual(ehSetting.capableThumbnailConfigRowCounts, EhSetting.ThumbnailRowCount.allCases) @@ -77,9 +76,9 @@ class EhSettingParserTests: XCTestCase, TestHelper { XCTAssertEqual(ehSetting.excludedUploaders, "") XCTAssertEqual(ehSetting.searchResultCount, .oneHundred) XCTAssertEqual(ehSetting.thumbnailLoadTiming, .onMouseOver) - XCTAssertEqual(ehSetting.thumbnailConfigSize, .normal) + XCTAssertEqual(ehSetting.thumbnailConfigSize, .auto) XCTAssertEqual(ehSetting.thumbnailConfigRows, .four) - XCTAssertEqual(ehSetting.thumbnailScaleFactor, 100) + XCTAssertEqual(ehSetting.coverScaleFactor, 100) XCTAssertEqual(ehSetting.viewportVirtualWidth, 0) XCTAssertEqual(ehSetting.commentsSortOrder, .oldest) XCTAssertEqual(ehSetting.commentVotesShowTiming, .onHoverOrClick)