Skip to content

Commit

Permalink
Merge pull request #354 from EhPanda-Team/develop
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
chihchy committed Nov 2, 2023
2 parents b3603cd + 6493d8f commit 0749bca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_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'
Expand Down
17 changes: 13 additions & 4 deletions EhPanda/Network/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions EhPanda/View/Reading/ReadingReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0749bca

Please sign in to comment.