(ctx context.Context)
| 359 | } |
| 360 | |
| 361 | func (se *scriptDriveEntry) Thumbnail(ctx context.Context) (types.IContentReader, error) { |
| 362 | vm, e := se.d.pool.Get(ctx) |
| 363 | if e != nil { |
| 364 | return nil, e |
| 365 | } |
| 366 | defer func() { _ = se.d.pool.Return(context.Background(), vm) }() |
| 367 | v, e := se.d.call(ctx, vm, "getThumbnail", s.NewContext(vm, ctx), se.s) |
| 368 | if e != nil { |
| 369 | return nil, e |
| 370 | } |
| 371 | raw := v.Raw() |
| 372 | // A reader was returned. Detach it so it survives the VM being returned to |
| 373 | // the pool; the caller owns closing it. |
| 374 | if rc := s.DetachReadCloser(vm, raw); rc != nil { |
| 375 | return wrapContentReader(rc), nil |
| 376 | } |
| 377 | if reader := s.GetReader(raw); reader != nil { |
| 378 | return wrapContentReader(wrapReader(reader)), nil |
| 379 | } |
| 380 | // Otherwise a ContentURL was returned. |
| 381 | r := types.ContentURL{} |
| 382 | v.ParseInto(&r) |
| 383 | return drive_util.NewURLContentReader(r.URL, r.Header, r.Proxy), nil |
| 384 | } |
nothing calls this directly
no test coverage detected