mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-11-12 05:30:47 +08:00
* fix(seed): keep CAS hash matrix for 189 rapid upload CAS seeds only carry MD5 + slice MD5s, but the quick-save path rebuilt the rapid-upload request through a torrent container, which requires SHA-1 piece hashes. Every 189 秒传 therefore failed before any request was sent and reported 'target driver cannot reuse the available hashes'. - build the rapid-upload request directly from the seed file, keeping the whole MD5, slice MD5s, the drive's slice size and the legacy slice digest - let 189pc run initMultiUpload/checkTransSecond/commitMultiUploadFile when slice hashes are available, falling back to the legacy whole-MD5 upload - surface the real rapid-upload error instead of the generic message * fix(189pc): surface daily flow limit instead of generic rapid-upload error The CAS path now reaches 189's upload API, and the first real rejection is UserDayFlowOverLimited (account daily upload flow exhausted). Treat it as a terminal account state instead of retrying: - add errs.DailyFlowLimitExceeded and map UserDayFlowOverLimited / 'flow is out' onto it (189 returns it as a business code inside HTTP 200) - skip the legacy whole-MD5 fallback once the account is limited - report 'rapid upload failed: ...' with the real reason and mark the rest of the batch unavailable instead of one request per file * fix(seed): refuse to generate a seed from a seed container Generating a .cas seed from a .cas file produced an artifact with exactly the same name in the same folder, so PutDirectly overwrote the original seed with a seed-of-seed: the payload then described the few-hundred-byte metadata file instead of the video. Rapid upload of that seed 'succeeds' and only creates another .cas, which looks like CAS 秒传 doing nothing. - skip .oss/.torrent/.cas/.cas.torrent when expanding a directory - reject an explicit selection of a seed container with an actionable message - refuse to write an artifact over one of its own source files * refactor(cas): derive slice size from file size and store the final digest CAS 判重只比较最终分片摘要(逐片 MD5 汇总后再取 MD5),而切法由文件大小固定:10MiB / 20MiB / 更大文件按 1999 片上限向上取 10MiB 的整数倍。之前把 sliceMd5 当成「可变分片的哈希」、总是从逐片列表现算,切法一变就对不上云端。 - add torrent.CASSliceSize / CASPartCount / CASUniformSliceSize as the single source of truth; 189pc.partSize delegates to it - .cas writes the final digest in sliceMd5 and the per-slice list in partsMd5; slice_md5s stays readable for old files - rapid upload prefers the explicit sliceMd5 and only derives it from parts when absent - generation, recalculate and inline conversion hash CAS files at CASSliceSize per file and drop parts that do not match that slicing - piece_size no longer influences CAS hashing * fix(seed): refuse to rapid-upload a seed that describes itself A .cas generated from another .cas documents the metadata file itself (name ends with .cas, a few hundred bytes). Rapid-uploading it just creates another same-named .cas in the target folder, which looks like CAS 秒传 doing nothing. Reject that case with an actionable message instead. * test(seed): lock the rapid-upload name and the seed-of-seed guard - extract seedRapidUploadBlocker so the guard is testable - add an end-to-end test proving a legacy 5-field .cas resolves to the video name, size, slice size and final slice MD5 - add a test that seed containers are refused for rapid upload * refactor(seed): output seed and torrent messages in English Turn the error strings, task statuses and progress labels of the transfer-seed / torrent feature into English, including the 189 CAS rapid-upload path and the front-end facing guards. Comments and unrelated log lines are untouched. * refactor(cas): make the CAS slice rule a verbatim port of the 189 upload rule CAS slice size must be exactly what 189 uses when uploading, otherwise the sliceMd5 submitted for rapid upload can never match the digest the drive stored. - CASSliceSize now copies 189pc partSize expression by expression (same DEFAULT constant, same float expression, same 5x lower bound) - expectedCASPartCount mirrors fastUpload's count: one slice when size <= sliceSize, otherwise ceil(size/sliceSize) - add cross-package tests comparing CASSliceSize/CASPartCount against a verbatim copy of the 189 rule, and partSize against CASSliceSize * fix(seed): address CAS sidecar and digest review findings P1 FsStream hashed uploads with seedPieceSize() while the sidecar declared the CAS slice size; unknown-size CAS uploads now fail before writing the file instead of after. P1 buildCASFileEntry only compared piece counts, so 8MiB slices could be reused as 10MiB CAS slices; it now requires the slicing to match. P2 multi-slice payloads without sliceMd5 are rejected instead of falling back to the whole-file MD5, and oversized CAS slice sizes are clamped for the seed container only. --------- Co-authored-by: pikachuren <pikachuren@example.com>