Do conversion inside collections.Add
This commit is contained in:
parent
05dee79560
commit
c932df0252
@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||
"github.com/spatialcurrent/go-lazy/pkg/lazy"
|
||||
|
||||
"github.com/alcionai/corso/src/internal/common/idname"
|
||||
@ -193,11 +194,11 @@ func newColl(
|
||||
// Adds an itemID to the collection. This will make it eligible to be
|
||||
// populated. The return values denotes if the item was previously
|
||||
// present or is new one.
|
||||
func (oc *Collection) Add(cdi CorsoDriveItemable) bool {
|
||||
func (oc *Collection) Add(item models.DriveItemable) bool {
|
||||
// _, found := oc.driveItems[ptr.Val(item.GetId())]
|
||||
// oc.driveItems[ptr.Val(item.GetId())] = item
|
||||
|
||||
//cdi := ToCorsoDriveItemable(item)
|
||||
cdi := ToCorsoDriveItemable(item)
|
||||
_, found := oc.driveItems[ptr.Val(cdi.GetId())]
|
||||
oc.driveItems[ptr.Val(cdi.GetId())] = cdi
|
||||
|
||||
|
||||
@ -696,7 +696,7 @@ func (c *Collections) handleDelete(
|
||||
|
||||
func (c *Collections) getCollectionPath(
|
||||
driveID string,
|
||||
item CorsoDriveItemable,
|
||||
item models.DriveItemable,
|
||||
) (path.Path, error) {
|
||||
var (
|
||||
pb = odConsts.DriveFolderPrefixBuilder(driveID)
|
||||
@ -845,7 +845,7 @@ func (c *Collections) PopulateDriveCollections(
|
||||
|
||||
func (c *Collections) processItem(
|
||||
ctx context.Context,
|
||||
di models.DriveItemable,
|
||||
item models.DriveItemable,
|
||||
driveID, driveName string,
|
||||
oldPrevPaths, currPrevPaths, newPrevPaths map[string]string,
|
||||
seenFolders map[string]string,
|
||||
@ -855,7 +855,7 @@ func (c *Collections) processItem(
|
||||
counter *count.Bus,
|
||||
skipper fault.AddSkipper,
|
||||
) error {
|
||||
item := ToCorsoDriveItemable(di)
|
||||
// item := ToCorsoDriveItemable(di)
|
||||
|
||||
var (
|
||||
itemID = ptr.Val(item.GetId())
|
||||
@ -870,7 +870,7 @@ func (c *Collections) processItem(
|
||||
"item_is_folder", isFolder)
|
||||
|
||||
if item.GetMalware() != nil {
|
||||
addtl := graph.ItemInfo(di)
|
||||
addtl := graph.ItemInfo(item)
|
||||
skip := fault.FileSkip(fault.SkipMalware, driveID, itemID, itemName, addtl)
|
||||
|
||||
if isFolder {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user