diff --git a/server/models/Author.js b/server/models/Author.js index f3bbba57..40e7f75a 100644 --- a/server/models/Author.js +++ b/server/models/Author.js @@ -1,5 +1,6 @@ const { DataTypes, Model, where, fn, col } = require('sequelize') const parseNameString = require('../utils/parsers/parseNameString') +const { asciiOnlyToLowerCase } = require('../utils/index') class Author extends Model { constructor(values, options) { @@ -55,7 +56,7 @@ class Author extends Model { static async getByNameAndLibrary(authorName, libraryId) { return this.findOne({ where: [ - where(fn('lower', col('name')), authorName.toLowerCase()), + where(fn('lower', col('name')), asciiOnlyToLowerCase(authorName)), { libraryId } diff --git a/server/models/Series.js b/server/models/Series.js index c57a1a11..dc8d110f 100644 --- a/server/models/Series.js +++ b/server/models/Series.js @@ -1,6 +1,7 @@ const { DataTypes, Model, where, fn, col } = require('sequelize') const { getTitlePrefixAtEnd } = require('../utils/index') +const { asciiOnlyToLowerCase } = require('../utils/index') class Series extends Model { constructor(values, options) { @@ -41,7 +42,7 @@ class Series extends Model { static async getByNameAndLibrary(seriesName, libraryId) { return this.findOne({ where: [ - where(fn('lower', col('name')), seriesName.toLowerCase()), + where(fn('lower', col('name')), asciiOnlyToLowerCase(seriesName)), { libraryId }