Skip to content

Commit

Permalink
new item id for ocs
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Dec 1, 2023
1 parent 7d97c00 commit 6e68d22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/http/services/owncloud/ocgraph/drives.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/spaces"
"github.com/cs3org/reva/pkg/utils/list"
"github.com/cs3org/reva/pkg/utils/resourceid"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -149,7 +150,7 @@ func getDrivesForShares(ctx context.Context, gw gateway.GatewayAPIClient) ([]*li

// the prefix of the remote_item.id and rootid
idPrefix := base32.StdEncoding.EncodeToString([]byte(fmt.Sprintf("#s%s", stat.Info.Path)))
resourceIdEnc := base32.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s!%s", stat.Info.Id.StorageId, stat.Info.Id.OpaqueId)))
resourceIdEnc := base32.StdEncoding.EncodeToString([]byte(resourceid.OwnCloudResourceIDWrap(stat.Info.Id)))

space := &libregraph.Drive{
Id: libregraph.PtrString(fmt.Sprintf("%s$%s!%s", shareJailID, shareJailID, share.Id.OpaqueId)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package shares
import (
"bytes"
"context"
"encoding/base32"
"encoding/json"
"fmt"
"mime"
Expand Down Expand Up @@ -1146,7 +1147,10 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
s.MimeType = parsedMt
// TODO STime: &types.Timestamp{Seconds: info.Mtime.Seconds, Nanos: info.Mtime.Nanos},
// TODO Storage: int
s.ItemSource = resourceid.OwnCloudResourceIDWrap(info.Id)
itemID := base32.StdEncoding.EncodeToString([]byte(fmt.Sprintf("#s%s", info.Path)))
itemID += "!" + base32.StdEncoding.EncodeToString([]byte(resourceid.OwnCloudResourceIDWrap(info.Id)))

s.ItemSource = itemID
s.FileSource = s.ItemSource
switch {
case h.sharePrefix == "/":
Expand Down

0 comments on commit 6e68d22

Please sign in to comment.