feat(webdav): support oc:checksums (#8064 close #7472)

Ref: #7472
This commit is contained in:
shniubobo
2025-03-14 16:21:07 +00:00
committed by GitHub
parent 0126af4de0
commit 28b61a93fd
2 changed files with 25 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import (
"errors"
"hash"
"io"
"iter"
"github.com/alist-org/alist/v3/internal/errs"
log "github.com/sirupsen/logrus"
@ -226,3 +227,13 @@ func (hi HashInfo) GetHash(ht *HashType) string {
func (hi HashInfo) Export() map[*HashType]string {
return hi.h
}
func (hi HashInfo) All() iter.Seq2[*HashType, string] {
return func(yield func(*HashType, string) bool) {
for hashType, hashValue := range hi.h {
if !yield(hashType, hashValue) {
return
}
}
}
}