File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 "@internetarchive/ia-dropdown" : " ^1.3.8" ,
3232 "@internetarchive/infinite-scroller" : " 1.0.1" ,
3333 "@internetarchive/modal-manager" : " ^0.2.8" ,
34- "@internetarchive/search-service" : " ^1.3.2 " ,
34+ "@internetarchive/search-service" : " ^1.4.0 " ,
3535 "@internetarchive/shared-resize-observer" : " ^0.2.0" ,
3636 "@lit/localize" : " ^0.11.2" ,
3737 "dompurify" : " ^2.3.6" ,
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ export class TileModel {
127127 this . href = collapseRepeatedQuotes (
128128 result . review ?. __href__ ?? result . __href__ ?. value
129129 ) ;
130- this . identifier = result . identifier ;
130+ this . identifier = TileModel . cleanIdentifier ( result . identifier ) ;
131131 this . issue = result . issue ?. value ;
132132 this . itemCount = result . item_count ?. value ?? 0 ;
133133 this . mediatype = resolveMediatype ( result ) ;
@@ -210,6 +210,17 @@ export class TileModel {
210210
211211 return flags ;
212212 }
213+
214+ private static cleanIdentifier (
215+ identifier : string | undefined
216+ ) : string | undefined {
217+ // Some identifiers (e.g., from Whisper) represent documents rather than items, and
218+ // are suffixed with values that need to be stripped. Those values are separated
219+ // from the item identifier itself with '|'.
220+ const barIndex = identifier ?. indexOf ( '|' ) ?? - 1 ;
221+ const cleaned = barIndex > 0 ? identifier ?. slice ( 0 , barIndex ) : identifier ;
222+ return cleaned ;
223+ }
213224}
214225
215226export type RequestKind = 'full' | 'hits' | 'aggregations' ;
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ export class RestorationStateHandler
101101
102102 if ( state . searchType === SearchType . FULLTEXT ) {
103103 newParams . set ( 'sin' , 'TXT' ) ;
104+ } else if ( state . searchType === SearchType . RADIO ) {
105+ newParams . set ( 'sin' , 'RADIO' ) ;
104106 }
105107 if ( oldParams . get ( 'sin' ) === '' ) {
106108 // Treat empty sin the same as no sin at all
@@ -264,6 +266,9 @@ export class RestorationStateHandler
264266 case 'TXT' :
265267 restorationState . searchType = SearchType . FULLTEXT ;
266268 break ;
269+ case 'RADIO' :
270+ restorationState . searchType = SearchType . RADIO ;
271+ break ;
267272 default :
268273 restorationState . searchType = SearchType . METADATA ;
269274 break ;
Original file line number Diff line number Diff line change 211211 resolved "https://registry.npmjs.org/@internetarchive/result-type/-/result-type-0.0.1.tgz"
212212 integrity sha512-sWahff5oP1xAK1CwAu1/5GTG2RXsdx/sQKn4SSOWH0r0vU2QoX9kAom/jSXeBsmgK0IjTc+9Ty9407SMORi+nQ==
213213
214- " @internetarchive/search-service@^1.3.2 " :
215- version "1.3.2 "
216- resolved "https://registry.yarnpkg.com/@internetarchive/search-service/-/search-service-1.3.2 .tgz#713b1172ee13b3e3f3c72c85eb37b7c5e27b2b53 "
217- integrity sha512-FiGZ13QWreeKZQ9Cpfr2cy2i9t9NRFa7pQMwVA9y+fZZwY/PyoWlPQKQySAmnjv3OKrq1I9LdZUkZ9EP4LNhxw ==
214+ " @internetarchive/search-service@^1.4.0 " :
215+ version "1.4.0 "
216+ resolved "https://registry.yarnpkg.com/@internetarchive/search-service/-/search-service-1.4.0 .tgz#e8fea0609eaf832b3fcdb02acb21e1a6c79bf028 "
217+ integrity sha512-6+GH5NbDLE1v+JfY5Ryo1GnsTUbpkbX/B0NCkoB25iYQZA82AbiNEyb6M6X332/5mUDRTGx6HKi+74CcJpDVEw ==
218218 dependencies :
219219 " @internetarchive/field-parsers" " ^0.1.4"
220220 " @internetarchive/result-type" " ^0.0.1"
You can’t perform that action at this time.
0 commit comments