File tree Expand file tree Collapse file tree
colrev/packages/crossref/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -465,16 +465,28 @@ def _create_query_url(
465465 print (record .data )
466466 raise AssertionError
467467
468- bibl = (
469- record .data [Fields .TITLE ].replace ("-" , "_" )
470- + " "
471- + record .data .get (Fields .YEAR , "" )
472- )
468+ bibl = ""
469+ if Fields .TITLE in record .data and record .data [Fields .TITLE ] not in [
470+ "" ,
471+ "NA" ,
472+ "UNKNOWN" ,
473+ ]:
474+ bibl += record .data [Fields .TITLE ]
475+ if Fields .YEAR in record .data and record .data [Fields .YEAR ] not in [
476+ "" ,
477+ "NA" ,
478+ "UNKNOWN" ,
479+ ]:
480+ bibl += record .data [Fields .YEAR ]
481+
473482 bibl = re .sub (r"[\W]+" , "" , bibl .replace (" " , "_" ))
474483 params ["query.bibliographic" ] = bibl .replace ("_" , " " ).rstrip ("+" )
475-
476484 container_title = record .get_container_title ()
477- if "." not in container_title :
485+ if "." not in container_title and container_title not in [
486+ "NA" ,
487+ "" ,
488+ "UNKNOWN" ,
489+ ]:
478490 container_title = container_title .replace (" " , "_" )
479491 container_title = re .sub (r"[\W]+" , "" , container_title )
480492 params ["query.container-title" ] = container_title .replace ("_" , " " )
You can’t perform that action at this time.
0 commit comments