fixed id parent on root on root

This commit is contained in:
Djeeberjr 2021-11-25 01:57:24 +01:00
parent 979ebee677
commit 47befe6db1

View File

@ -69,9 +69,15 @@ func (i ID) Parent() *ID {
Key: strings.Join(parts[:len(parts)-2], "/") + "/",
}
} else {
dir := filepath.Dir(i.Key)
if dir != "/" {
dir += "/"
}
parent = &ID{
Bucket: i.Bucket,
Key: filepath.Dir(i.Key) + "/",
Key: dir,
}
}