feat: 优化云盘工作区与批量文件工具
This commit is contained in:
@@ -232,7 +232,7 @@ final class GuangyaAPI: @unchecked Sendable {
|
||||
func fsDetail(fileID: String) async throws -> JSONValue {
|
||||
// Build the payload explicitly so the 19-digit resource ID can never pass
|
||||
// through the Any/NSNumber conversion path and lose its JSON string type.
|
||||
try await apiRequest("/userres/v1/file/get_file_detail", body: .object(["fileId": .string(fileID)]))
|
||||
try await apiRequest("/nd.bizuserres.s/v1/file/get_file_detail", body: .object(["fileId": .string(fileID)]))
|
||||
}
|
||||
|
||||
func vodDownloadURL(fileID: String, gcid: String) async throws -> JSONValue {
|
||||
@@ -517,4 +517,3 @@ final class GuangyaAPI: @unchecked Sendable {
|
||||
private static func calculateGCID(data: Data) -> String { let chunkSize = data.count <= 0x8000000 ? 262144 : data.count <= 0x10000000 ? 524288 : data.count <= 0x20000000 ? 1048576 : 2097152; var hashes = Data(); var offset = 0; while offset < data.count { let end = min(offset + chunkSize, data.count); hashes.append(contentsOf: Insecure.SHA1.hash(data: data.subdata(in: offset..<end))); offset = end }; return Insecure.SHA1.hash(data: hashes).map { String(format: "%02X", $0) }.joined() }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user