Skip to content

Commit 5e14c86

Browse files
authored
Merge branch 'OpenListTeam:main' into main
2 parents 6a81227 + 1f9a7e3 commit 5e14c86

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/mega/driver.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ func (d *Mega) Put(ctx context.Context, dstDir model.Obj, stream model.FileStrea
195195
return fmt.Errorf("unable to convert dir to mega n")
196196
}
197197

198+
func (d *Mega) GetDetails(ctx context.Context) (*model.StorageDetails, error) {
199+
quota, err := d.c.GetQuota()
200+
if err != nil {
201+
return nil, err
202+
}
203+
return &model.StorageDetails{
204+
DiskUsage: driver.DiskUsageFromUsedAndTotal(quota.Cstrg, quota.Mstrg),
205+
}, nil
206+
}
207+
198208
//func (d *Mega) Other(ctx context.Context, args model.OtherArgs) (interface{}, error) {
199209
// return nil, errs.NotSupport
200210
//}

0 commit comments

Comments
 (0)