Fix UW Madison catalog (#2828)

这个提交包含在:
Sebastian Karcher 2022-05-31 09:52:23 -04:00 提交者 GitHub
父节点 32f2271bf0
当前提交 056195ff97
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-11-18 23:11:36"
"lastUpdated": "2022-05-31 01:20:34"
}
/*
@ -75,7 +75,7 @@ function detectWeb(doc, url) {
}
function getFormat(doc) {
return ZU.xpathText(doc, '//span[@class="pub_title" and contains(., "Format")]/following-sibling::span[@class="pub_desc"]');
return text(doc, '.type');
}
function getSearchResults(doc, checkOnly) {
@ -121,7 +121,7 @@ function scrape(doc, url) {
text = text.replace(/^(AU\s+-.*), \d\d\d\d-(\d\d\d\d)?$/m, "$1");
// music scores should be treated as book
text = text.replace('TY - MUSIC', 'TY - BOOK');
if (getFormat(doc).includes('Book')) {
if (getFormat(doc) && getFormat(doc).includes('Book')) {
// fix for an odd RIS issue in one of the tests - a book is tagged
// as a presentation
text = text.replace('TY - SLIDE', 'TY - BOOK');