Premiumize: Fix service-specific errors
This parameter should be optional and errors if it isn't. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
90f44348b8
commit
796cc65016
2 changed files with 4 additions and 3 deletions
|
|
@ -203,9 +203,10 @@ public class Premiumize: OAuthDebridSource, ObservableObject {
|
||||||
|
|
||||||
let data = try await performRequest(request: &request, requestName: #function)
|
let data = try await performRequest(request: &request, requestName: #function)
|
||||||
let rawResponse = try jsonDecoder.decode(DDLResponse.self, from: data)
|
let rawResponse = try jsonDecoder.decode(DDLResponse.self, from: data)
|
||||||
|
let content = rawResponse.content ?? []
|
||||||
|
|
||||||
if !rawResponse.content.isEmpty {
|
if !content.isEmpty {
|
||||||
let files = rawResponse.content.map { file in
|
let files = content.map { file in
|
||||||
DebridIAFile(
|
DebridIAFile(
|
||||||
fileId: 0,
|
fileId: 0,
|
||||||
name: file.path.split(separator: "/").last.flatMap { String($0) } ?? file.path,
|
name: file.path.split(separator: "/").last.flatMap { String($0) } ?? file.path,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public extension Premiumize {
|
||||||
|
|
||||||
struct DDLResponse: Codable {
|
struct DDLResponse: Codable {
|
||||||
let status: String
|
let status: String
|
||||||
let content: [DDLData]
|
let content: [DDLData]?
|
||||||
let location: String
|
let location: String
|
||||||
let filename: String
|
let filename: String
|
||||||
let filesize: Int
|
let filesize: Int
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue