@@ -4,15 +4,14 @@ import { UmbImagingRepository } from '@umbraco-cms/backoffice/imaging';
4
4
import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api' ;
5
5
import { UmbDefaultCollectionContext } from '@umbraco-cms/backoffice/collection' ;
6
6
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
7
- import { ImageCropModeModel } from '@umbraco-cms/backoffice/external/backend-api' ;
8
7
9
8
export class UmbMediaCollectionContext extends UmbDefaultCollectionContext <
10
9
UmbMediaCollectionItemModel ,
11
10
UmbMediaCollectionFilterModel
12
11
> {
13
12
#imagingRepository: UmbImagingRepository ;
14
13
15
- #thumbnailItems = new UmbArrayState < UmbMediaCollectionItemModel > ( [ ] , ( x ) => x ) ;
14
+ #thumbnailItems = new UmbArrayState < UmbMediaCollectionItemModel > ( [ ] , ( x ) => x . unique ) ;
16
15
public readonly thumbnailItems = this . #thumbnailItems. asObservable ( ) ;
17
16
18
17
constructor ( host : UmbControllerHost ) {
@@ -22,9 +21,10 @@ export class UmbMediaCollectionContext extends UmbDefaultCollectionContext<
22
21
this . observe ( this . items , async ( items ) => {
23
22
if ( ! items ?. length ) return ;
24
23
25
- const { data } = await this . #imagingRepository. requestResizedItems (
24
+ const { data } = await this . #imagingRepository. requestThumbnailUrls (
26
25
items . map ( ( m ) => m . unique ) ,
27
- { height : 400 , width : 400 , mode : ImageCropModeModel . MIN } ,
26
+ 400 ,
27
+ 400 ,
28
28
) ;
29
29
30
30
this . #thumbnailItems. setValue (
0 commit comments