From e755759277b0a6a43dae0ba7f6a7cc3d3c3fd381 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 23 Feb 2012 16:48:11 -0500 Subject: [PATCH] Avoid double-proxying boreal links Signed-off-by: Dan Scott --- tools/ebooks/prep_ebook_records.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/ebooks/prep_ebook_records.py b/tools/ebooks/prep_ebook_records.py index 54a39a0118..597b82f3fc 100644 --- a/tools/ebooks/prep_ebook_records.py +++ b/tools/ebooks/prep_ebook_records.py @@ -593,6 +593,8 @@ def mark_isbn_for_sfx(record, options): isbnval = clean_isbn(isbnval) # And for every library we have enabled for lib in options['libraries']: + if lib == 'boreal': + return False found = check_for_isbn(options, lib, isbnval) if found: # Add the $9 subfield to mark this as a good one @@ -898,7 +900,10 @@ def get_subfields(field, data): if ebrary and data['ebrary_code'] != 'boreal': subs.extend(['u', url]) else: - subs.extend(['u', data['proxy'] + field['u']]) + if data['ebrary_code'] == 'boreal' and re.search(r'ra.ocls.ca', field['u']): + subs.extend(['u', field['u']]) + else: + subs.extend(['u', data['proxy'] + field['u']]) # Check for a $z as the first 856; in Springer records, at least, this # indicates a multi-volume set that requires keeping the $z around -- 2.11.0