Put back download url

This commit is contained in:
Abhishek Pandey 2023-11-29 00:23:13 -08:00
parent bf3b232319
commit 368e5e9531

View File

@ -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{