|
|
@ -93,8 +93,7 @@ func (b *LocalBackend) driveSetShareLocked(share *drive.Share) (views.SliceView[
|
|
|
|
|
|
|
|
|
|
|
|
addedShare := false
|
|
|
|
addedShare := false
|
|
|
|
var shares []*drive.Share
|
|
|
|
var shares []*drive.Share
|
|
|
|
for i := range existingShares.Len() {
|
|
|
|
for _, existing := range existingShares.All() {
|
|
|
|
existing := existingShares.At(i)
|
|
|
|
|
|
|
|
if existing.Name() != share.Name {
|
|
|
|
if existing.Name() != share.Name {
|
|
|
|
if !addedShare && existing.Name() > share.Name {
|
|
|
|
if !addedShare && existing.Name() > share.Name {
|
|
|
|
// Add share in order
|
|
|
|
// Add share in order
|
|
|
@ -152,8 +151,7 @@ func (b *LocalBackend) driveRenameShareLocked(oldName, newName string) (views.Sl
|
|
|
|
|
|
|
|
|
|
|
|
found := false
|
|
|
|
found := false
|
|
|
|
var shares []*drive.Share
|
|
|
|
var shares []*drive.Share
|
|
|
|
for i := range existingShares.Len() {
|
|
|
|
for _, existing := range existingShares.All() {
|
|
|
|
existing := existingShares.At(i)
|
|
|
|
|
|
|
|
if existing.Name() == newName {
|
|
|
|
if existing.Name() == newName {
|
|
|
|
return existingShares, os.ErrExist
|
|
|
|
return existingShares, os.ErrExist
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -213,8 +211,7 @@ func (b *LocalBackend) driveRemoveShareLocked(name string) (views.SliceView[*dri
|
|
|
|
|
|
|
|
|
|
|
|
found := false
|
|
|
|
found := false
|
|
|
|
var shares []*drive.Share
|
|
|
|
var shares []*drive.Share
|
|
|
|
for i := range existingShares.Len() {
|
|
|
|
for _, existing := range existingShares.All() {
|
|
|
|
existing := existingShares.At(i)
|
|
|
|
|
|
|
|
if existing.Name() != name {
|
|
|
|
if existing.Name() != name {
|
|
|
|
shares = append(shares, existing.AsStruct())
|
|
|
|
shares = append(shares, existing.AsStruct())
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|