From e29d3a36727db4cf0358970869d9d5e5695ce0f4 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 15 Mar 2025 17:41:07 -0500 Subject: [PATCH] Cast OpenLibrary publishYear to string #4114 --- server/providers/OpenLibrary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/providers/OpenLibrary.js b/server/providers/OpenLibrary.js index 453c919b..10d03378 100644 --- a/server/providers/OpenLibrary.js +++ b/server/providers/OpenLibrary.js @@ -66,10 +66,10 @@ class OpenLibrary { } parsePublishYear(doc, worksData) { - if (doc.first_publish_year && !isNaN(doc.first_publish_year)) return doc.first_publish_year + if (doc.first_publish_year && !isNaN(doc.first_publish_year)) return String(doc.first_publish_year) if (worksData.first_publish_date) { var year = worksData.first_publish_date.split('-')[0] - if (!isNaN(year)) return year + if (!isNaN(year)) return String(year) } return null }