@@ -121,6 +121,11 @@ export class CollectionBrowserDataSource
121
121
*/
122
122
collectionTitles = new Map < string , string > ( ) ;
123
123
124
+ /**
125
+ * @inheritdoc
126
+ */
127
+ tvChannelAliases = new Map < string , string > ( ) ;
128
+
124
129
/**
125
130
* @inheritdoc
126
131
*/
@@ -1031,19 +1036,25 @@ export class CollectionBrowserDataSource
1031
1036
return ;
1032
1037
}
1033
1038
1034
- const { aggregations, collectionTitles } = success . response ;
1039
+ const { aggregations, collectionTitles, tvChannelAliases } =
1040
+ success . response ;
1035
1041
this . aggregations = aggregations ;
1036
1042
1043
+ this . histogramAggregation =
1044
+ this . host . searchType === SearchType . TV
1045
+ ? aggregations ?. date_histogram
1046
+ : aggregations ?. year_histogram ;
1047
+
1037
1048
if ( collectionTitles ) {
1038
1049
for ( const [ id , title ] of Object . entries ( collectionTitles ) ) {
1039
1050
this . collectionTitles . set ( id , title ) ;
1040
1051
}
1041
1052
}
1042
-
1043
- this . histogramAggregation =
1044
- this . host . searchType === SearchType . TV
1045
- ? aggregations ?. date_histogram
1046
- : aggregations ?. year_histogram ;
1053
+ if ( tvChannelAliases ) {
1054
+ for ( const [ channel , network ] of Object . entries ( tvChannelAliases ) ) {
1055
+ this . tvChannelAliases . set ( channel , network ) ;
1056
+ }
1057
+ }
1047
1058
1048
1059
this . setFacetsLoading ( false ) ;
1049
1060
this . requestHostUpdate ( ) ;
@@ -1191,7 +1202,7 @@ export class CollectionBrowserDataSource
1191
1202
this . pageElements = success . response . pageElements ;
1192
1203
}
1193
1204
1194
- const { results, collectionTitles } = success . response ;
1205
+ const { results, collectionTitles, tvChannelAliases } = success . response ;
1195
1206
if ( results && results . length > 0 ) {
1196
1207
// Load any collection titles present on the response into the cache,
1197
1208
// or queue up preload fetches for them if none were present.
@@ -1207,6 +1218,12 @@ export class CollectionBrowserDataSource
1207
1218
}
1208
1219
}
1209
1220
1221
+ if ( tvChannelAliases ) {
1222
+ for ( const [ channel , network ] of Object . entries ( tvChannelAliases ) ) {
1223
+ this . tvChannelAliases . set ( channel , network ) ;
1224
+ }
1225
+ }
1226
+
1210
1227
// Update the data source for each returned page.
1211
1228
// For loans and web archives, we must account for receiving more pages than we asked for.
1212
1229
const isUnpagedElement = [ 'lending' , 'web_archives' ] . includes (
0 commit comments