Skip to content

Commit

Permalink
Merge pull request #12 from ishank011/full-paths
Browse files Browse the repository at this point in the history
Change order when deciding whether to keep full paths
  • Loading branch information
diocas authored Oct 25, 2021
2 parents a1c7710 + 8ad3bd0 commit 5ece2c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -848,12 +848,12 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
s.ItemSource = wrapResourceID(info.Id)
s.FileSource = s.ItemSource
switch {
case s.ShareType == conversions.ShareTypePublicLink:
s.FileTarget = info.Path
s.Path = info.Path
case h.sharePrefix == "/":
s.FileTarget = info.Path
s.Path = info.Path
case s.ShareType == conversions.ShareTypePublicLink:
s.FileTarget = path.Join("/", path.Base(info.Path))
s.Path = path.Join("/", path.Base(info.Path))
default:
s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path))
s.Path = path.Join("/", path.Base(info.Path))
Expand Down

0 comments on commit 5ece2c7

Please sign in to comment.