From 368e5e9531bcf5619a45f3770d248841e0296076 Mon Sep 17 00:00:00 2001 From: Abhishek Pandey Date: Wed, 29 Nov 2023 00:23:13 -0800 Subject: [PATCH] Put back download url --- .../collection/drive/custom_drive_item.go | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/internal/m365/collection/drive/custom_drive_item.go b/src/internal/m365/collection/drive/custom_drive_item.go index f8744906f..fb1c8a89f 100644 --- a/src/internal/m365/collection/drive/custom_drive_item.go +++ b/src/internal/m365/collection/drive/custom_drive_item.go @@ -4,6 +4,7 @@ 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" ) @@ -224,17 +225,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{