From 928c6cf5b3fbf4ad121a731e0d7de6edc104eb02 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 4 Oct 2022 17:41:26 -0500 Subject: [PATCH] Fix:iTunes returning artist names with & instead of all comma separated #1022 --- server/providers/iTunes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/providers/iTunes.js b/server/providers/iTunes.js index 143617b2..bdea2286 100644 --- a/server/providers/iTunes.js +++ b/server/providers/iTunes.js @@ -60,11 +60,15 @@ class iTunes { } cleanAudiobook(data) { + // artistName can be "Name1, Name2 & Name3" so we refactor this to "Name1, Name2, Name3" + // see: https://github.com/advplyr/audiobookshelf/issues/1022 + const author = (data.artistName || '').split(' & ').join(', ') + return { id: data.collectionId, artistId: data.artistId, title: data.collectionName, - author: data.artistName, + author, description: htmlSanitizer.stripAllTags(data.description || ''), publishedYear: data.releaseDate ? data.releaseDate.split('-')[0] : null, genres: data.primaryGenreName ? [data.primaryGenreName] : null,