diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b1eeb9fd..3a2960f0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,7 +6,7 @@ on: types: [closed] env: DEVELOPER_DIR: /Applications/Xcode_15.0.1.app - APP_VERSION: '2.7.2' + APP_VERSION: '2.7.3' SCHEME_NAME: 'EhPanda' ALTSTORE_JSON_PATH: './AltStore.json' BUILDS_PATH: '/tmp/action-builds' diff --git a/EhPanda/Network/Request.swift b/EhPanda/Network/Request.swift index 768031bb..d739ee09 100644 --- a/EhPanda/Network/Request.swift +++ b/EhPanda/Network/Request.swift @@ -612,9 +612,9 @@ struct GalleryMPVImageURLRequest: Request { let index: Int let mpvKey: String let mpvImageKey: String - let skipServerIdentifier: Int? + let skipServerIdentifier: String? - var publisher: AnyPublisher<(URL, URL?, Int), AppError> { + var publisher: AnyPublisher<(URL, URL?, String), AppError> { var params: [String: Any] = [ "method": "imagedispatch", "gid": gid, @@ -637,10 +637,19 @@ struct GalleryMPVImageURLRequest: Request { guard let dict = try JSONSerialization .jsonObject(with: data) as? [String: Any], let imageURLString = dict["i"] as? String, - let imageURL = URL(string: imageURLString), - let skipServerIdentifier = dict["s"] as? Int + let imageURL = URL(string: imageURLString) else { throw AppError.parseFailed } + var skipServerIdentifier: String? + + if let integerIdentifier = dict["s"] as? Int { + skipServerIdentifier = integerIdentifier.description + } else if let stringIdentifier = dict["s"] as? String { + skipServerIdentifier = stringIdentifier + } + + guard let skipServerIdentifier else { throw AppError.parseFailed } + if let originalImageURLStringSlice = dict["lf"] as? String { let originalImageURL = Defaults.URL.host.appendingPathComponent(originalImageURLStringSlice) return (imageURL, originalImageURL, skipServerIdentifier) diff --git a/EhPanda/View/Reading/ReadingReducer.swift b/EhPanda/View/Reading/ReadingReducer.swift index 15bf9682..96b5560b 100644 --- a/EhPanda/View/Reading/ReadingReducer.swift +++ b/EhPanda/View/Reading/ReadingReducer.swift @@ -69,7 +69,7 @@ struct ReadingReducer: ReducerProtocol { var mpvKey: String? var mpvImageKeys = [Int: String]() - var mpvSkipServerIdentifiers = [Int: Int]() + var mpvSkipServerIdentifiers = [Int: String]() @BindingState var showsPanel = false @BindingState var showsSliderPreview = false @@ -172,7 +172,7 @@ struct ReadingReducer: ReducerProtocol { case fetchMPVKeys(Int, URL) case fetchMPVKeysDone(Int, Result<(String, [Int: String]), AppError>) case fetchMPVImageURL(Int, Bool) - case fetchMPVImageURLDone(Int, Result<(URL, URL?, Int), AppError>) + case fetchMPVImageURLDone(Int, Result<(URL, URL?, String), AppError>) } @Dependency(\.appDelegateClient) private var appDelegateClient