diff --git a/server/models/Author.js b/server/models/Author.js index 790b35dd..220abeb8 100644 --- a/server/models/Author.js +++ b/server/models/Author.js @@ -114,11 +114,14 @@ class Author extends Model { static async getOldByNameAndLibrary(authorName, libraryId) { const author = (await this.findOne({ where: [ - literal(`name = '${authorName}' COLLATE NOCASE`), + literal(`name = ':authorName' COLLATE NOCASE`), { libraryId } - ] + ], + replacements: { + authorName + } }))?.getOldAuthor() return author } diff --git a/server/models/Series.js b/server/models/Series.js index e8407d5c..2b37002d 100644 --- a/server/models/Series.js +++ b/server/models/Series.js @@ -105,11 +105,14 @@ class Series extends Model { static async getOldByNameAndLibrary(seriesName, libraryId) { const series = (await this.findOne({ where: [ - literal(`name = '${seriesName}' COLLATE NOCASE`), + literal(`name = ':seriesName' COLLATE NOCASE`), { libraryId } - ] + ], + replacements: { + seriesName + } }))?.getOldSeries() return series }