mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-03-13 11:20:33 +00:00
fix(azure): remove properties and fix prefix (#2209)
Remove properties from azure blob response fix azure blob prefix filter: prefix should be empty if it is "/"
This commit is contained in:
@@ -85,6 +85,9 @@ func (d *AzureBlob) Drop(ctx context.Context) error {
|
||||
// List retrieves blobs and directories under the specified path.
|
||||
func (d *AzureBlob) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
||||
prefix := ensureTrailingSlash(dir.GetPath())
|
||||
if prefix == "/" {
|
||||
prefix = ""
|
||||
}
|
||||
|
||||
pager := d.containerClient.NewListBlobsHierarchyPager("/", &container.ListBlobsHierarchyOptions{
|
||||
Prefix: &prefix,
|
||||
@@ -102,8 +105,9 @@ func (d *AzureBlob) List(ctx context.Context, dir model.Obj, args model.ListArgs
|
||||
objs = append(objs, &model.Object{
|
||||
Name: path.Base(strings.TrimSuffix(*blobPrefix.Name, "/")),
|
||||
Path: *blobPrefix.Name,
|
||||
Modified: *blobPrefix.Properties.LastModified,
|
||||
Ctime: *blobPrefix.Properties.CreationTime,
|
||||
// Azure does not support properties now.
|
||||
//Modified: *blobPrefix.Properties.LastModified,
|
||||
//Ctime: *blobPrefix.Properties.CreationTime,
|
||||
IsFolder: true,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user