updated download command to use SearchResult struct

This commit is contained in:
a. fox 2024-02-29 21:43:57 -05:00
parent b00669a167
commit d8c47bd905
2 changed files with 7 additions and 3 deletions

View File

@ -57,14 +57,14 @@ extension Seanut {
let newPath = outputPath.appendingPathComponent(rootInfo.name!)
createDirectory(String(newPath.absoluteString.suffix(newPath.absoluteString.count - 7)))
let childReq: Request<[Item]> = Seanut.jellyfinRequest(
result: [Item()],
let childReq: Request<SearchResult> = Seanut.jellyfinRequest(
result: SearchResult(),
config: DownloadCommand.config,
path: "/Items",
method: .get,
query: [("userId", DownloadCommand.userId!), ("parentId", id)]
)
guard let childInfo = try? await DownloadCommand.client.send(childReq).value else {
guard let childInfo = try? await DownloadCommand.client.send(childReq).value.items else {
return
}

View File

@ -4,4 +4,8 @@ struct User: Codable {
let id: String?
init() { id = nil }
enum CodingKeys: String, CodingKey {
case id = "Id"
}
}