diff --git a/thesesfr/parser.js b/thesesfr/parser.js index e789b00d..486ca05d 100755 --- a/thesesfr/parser.js +++ b/thesesfr/parser.js @@ -28,7 +28,7 @@ module.exports = new Parser(function analyseEC(parsedUrl, ec) { result.unitid = match[1]; result.publication_date = match[2]; result.institution_code = match[3]; - switch (ec.status) { + switch (Number.parseInt(ec.status, 10)) { case 200: result.mime = 'PDF'; break; diff --git a/thesesfr/test/thesesfr.2024-07-18.csv b/thesesfr/test/thesesfr.2024-07-18.csv index 16b260da..b85aa8e5 100644 --- a/thesesfr/test/thesesfr.2024-07-18.csv +++ b/thesesfr/test/thesesfr.2024-07-18.csv @@ -1,10 +1,10 @@ -out-publication_date;out-ppn;out-unitid;out-rtype;out-mime;out-publication_date;out-institution_code;in-url -;;2019LYSE2053;PHD_THESIS;MISC;2019;LYSE;https://theses.fr/api/v1/document/2019LYSE2053 -;;2010AIX22039;PHD_THESIS;MISC;2010;AIX2;https://theses.fr/api/v1/document/2010AIX22039 -;264066944;264066944;BIO;HTML;;;https://theses.fr/264066944 -;264066944;264066944;BIO;HTML;;;https://theses.fr/api/v1/personnes/personne/264066944 -;;s383095;ABS;HTML;;;https://theses.fr/s383095 -;;s383095;ABS;HTML;;;https://theses.fr/api/v1/theses/these/s383095 -2023;;2024BORD0122;ABS;HTML;2024;BORD;https://theses.fr/2024BORD0122 -2023;;2024BORD0122;ABS;HTML;2024;BORD;https://theses.fr/api/v1/theses/these/2024BORD0122 -;;;SEARCH;HTML;;;https://theses.fr/api/v1/theses/recherche/?q=test&debut=0&nombre=10&tri=pertinence \ No newline at end of file +out-publication_date;out-ppn;out-unitid;out-rtype;out-mime;out-publication_date;out-institution_code;in-url;in-status +;;2019LYSE2053;PHD_THESIS;PDF;2019;LYSE;https://theses.fr/api/v1/document/2019LYSE2053;200 +;;2010AIX22039;PHD_THESIS;HTML;2010;AIX2;https://theses.fr/api/v1/document/2010AIX22039;302 +;264066944;264066944;BIO;HTML;;;https://theses.fr/264066944;200 +;264066944;264066944;BIO;HTML;;;https://theses.fr/api/v1/personnes/personne/264066944;200 +;;s383095;ABS;HTML;;;https://theses.fr/s383095;200 +;;s383095;ABS;HTML;;;https://theses.fr/api/v1/theses/these/s383095;200 +2023;;2024BORD0122;ABS;HTML;2024;BORD;https://theses.fr/2024BORD0122;200 +2023;;2024BORD0122;ABS;HTML;2024;BORD;https://theses.fr/api/v1/theses/these/2024BORD0122;200 +;;;SEARCH;HTML;;;https://theses.fr/api/v1/theses/recherche/?q=test&debut=0&nombre=10&tri=pertinence;200 \ No newline at end of file