@@ -114,12 +114,16 @@ export async function listActors(
114
114
) : Promise < INodeListSearchResult > {
115
115
const actorSource = this . getNodeParameter ( 'actorSource' , 'recentlyUsed' ) as string ;
116
116
117
- const mapToN8nResult = ( actor : any ) => ( {
118
- name : actor . title || actor . name ,
119
- value : actor . id ,
120
- url : `https://console.apify.com/actors/${ actor . id } /input` ,
121
- description : actor . description || actor . name ,
122
- } ) ;
117
+ const mapToN8nSelectOption = ( actor : any ) => {
118
+ const optionName = actor . title ? `${ actor . title } (${ actor . name } )` : actor . name ;
119
+
120
+ return {
121
+ name : optionName ,
122
+ value : actor . id ,
123
+ url : `https://console.apify.com/actors/${ actor . id } /input` ,
124
+ description : actor . description || actor . name ,
125
+ } ;
126
+ } ;
123
127
124
128
const {
125
129
data : { items : recentActors } ,
@@ -139,11 +143,11 @@ export async function listActors(
139
143
( actor : any ) => regex . test ( actor . title || '' ) || regex . test ( actor . name || '' ) ,
140
144
) ;
141
145
return {
142
- results : filteredActors . map ( mapToN8nResult ) ,
146
+ results : filteredActors . map ( mapToN8nSelectOption ) ,
143
147
} ;
144
148
}
145
149
return {
146
- results : recentActors . map ( mapToN8nResult ) ,
150
+ results : recentActors . map ( mapToN8nSelectOption ) ,
147
151
} ;
148
152
}
149
153
@@ -159,10 +163,7 @@ export async function listActors(
159
163
} ,
160
164
} ) ;
161
165
162
- const recentIds = recentActors . map ( ( actor : any ) => actor . id ) ;
163
- const filtered = storeActors . filter ( ( actor : any ) => ! recentIds . includes ( actor . id ) ) ;
164
-
165
166
return {
166
- results : filtered . map ( mapToN8nResult ) ,
167
+ results : storeActors . map ( mapToN8nSelectOption ) ,
167
168
} ;
168
169
}
0 commit comments