diff --git a/src/internal/m365/collection/drive/collection.go b/src/internal/m365/collection/drive/collection.go index 1271e2bf5..65cb09077 100644 --- a/src/internal/m365/collection/drive/collection.go +++ b/src/internal/m365/collection/drive/collection.go @@ -198,11 +198,11 @@ func (oc *Collection) Add(cdi CorsoDriveItemable) bool { // oc.driveItems[ptr.Val(item.GetId())] = item //cdi := ToCorsoDriveItemable(item) - //_, found := oc.driveItems[ptr.Val(cdi.GetId())] - //oc.driveItems[ptr.Val(cdi.GetId())] = cdi + _, found := oc.driveItems[ptr.Val(cdi.GetId())] + oc.driveItems[ptr.Val(cdi.GetId())] = cdi // if !found, it's a new addition - return true + return !found } // Remove removes a item from the collection diff --git a/src/internal/m365/collection/drive/custom_drive_item.go b/src/internal/m365/collection/drive/custom_drive_item.go index 3e8bf85c3..f8744906f 100644 --- a/src/internal/m365/collection/drive/custom_drive_item.go +++ b/src/internal/m365/collection/drive/custom_drive_item.go @@ -4,7 +4,6 @@ import ( "time" "github.com/alcionai/corso/src/internal/common/ptr" - "github.com/alcionai/corso/src/internal/common/str" "github.com/microsoftgraph/msgraph-sdk-go/models" ) @@ -225,17 +224,17 @@ func ToCorsoDriveItemable(item models.DriveItemable) CorsoDriveItemable { // Hacky way to cache the download url. Thats all we use from additional data // Otherwise, we'll hold a reference to the underlying store which will consume // lot more memory. - if item.GetFile() != nil { - ad := make(map[string]interface{}) - for _, key := range downloadURLKeys { - if v, err := str.AnyValueToString(key, item.GetAdditionalData()); err == nil { - ad[key] = v - break - } - } + // if item.GetFile() != nil { + // ad := make(map[string]interface{}) + // for _, key := range downloadURLKeys { + // if v, err := str.AnyValueToString(key, item.GetAdditionalData()); err == nil { + // ad[key] = v + // break + // } + // } - cdi.AdditionalData = ad - } + // cdi.AdditionalData = ad + // } if item.GetFolder() != nil { cdi.Folder = &folderDriveItem{ @@ -289,26 +288,26 @@ func ToCorsoDriveItemable(item models.DriveItemable) CorsoDriveItemable { } } - if item.GetCreatedBy() != nil && item.GetCreatedBy().GetUser() != nil { - additionalData := item.GetCreatedBy().GetUser().GetAdditionalData() - ad := make(map[string]interface{}) - var str string + // if item.GetCreatedBy() != nil && item.GetCreatedBy().GetUser() != nil { + // additionalData := item.GetCreatedBy().GetUser().GetAdditionalData() + // ad := make(map[string]interface{}) + // var str string - ed, ok := additionalData["email"] - if ok { - str = ptr.Val(ed.(*string)) - ad["email"] = &str - } else if ed, ok = additionalData["displayName"]; ok { - str = ptr.Val(ed.(*string)) - ad["displayName"] = &str - } + // ed, ok := additionalData["email"] + // if ok { + // str = ptr.Val(ed.(*string)) + // ad["email"] = &str + // } else if ed, ok = additionalData["displayName"]; ok { + // str = ptr.Val(ed.(*string)) + // ad["displayName"] = &str + // } - cdi.CreatedBy = &itemIdentitySet{ - user: &itemUser{ - additionalData: ad, - }, - } - } + // cdi.CreatedBy = &itemIdentitySet{ + // user: &itemUser{ + // additionalData: ad, + // }, + // } + // } return cdi }