alexiscn / SynologyKit

Synology File Station SDK for Swift
MIT License
37 stars 8 forks source link

MD5 error #15

Open g-mocken opened 3 months ago

g-mocken commented 3 months ago

I have an idea for an app, which would use the MD5 command to check whether a file exists and is complete before uploading a fresh copy of the same file. But when trying out the sample app, the MD5 feature only seems to work sometimes. Most of the times I get:

"Error Code:599, response: success(Optional(38 bytes))"
No such task of the file operation

in the Xcode console (and only sometimes it prints the correct MD5 hash instead).

g-mocken commented 3 months ago

Extra quotes (hint came from here) in func checkTaskStatus seem to help: statusRequest.params["taskid"] = "\"\(task.taskid)\""

The Synology API guide also has extra quotes (%22) around the taskid in its example on page 104:

GET /webapi/entry.cgi?api=SYNO.FileStation.Compress&version=3&method=status&
taskid=%22FileStation_51CBB25CC31961FD%22