mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Temporariliy disable sqlite3 unicode extension on linux-arm64
This commit is contained in:
parent
8ff7b6b6e6
commit
87727d5f68
1 changed files with 11 additions and 10 deletions
|
|
@ -17,6 +17,14 @@ class Database {
|
|||
|
||||
this.settings = []
|
||||
|
||||
this.loadUnicodeExtionsion = process.platform === 'linux' && process.arch === 'arm64' ? false : true
|
||||
|
||||
if (this.loadUnicodeExtionsion) {
|
||||
this.normalize = (value) => `lower(unaccent(${value}))`
|
||||
} else {
|
||||
this.normalize = (value) => value
|
||||
}
|
||||
|
||||
// Cached library filter data
|
||||
this.libraryFilterData = {}
|
||||
|
||||
|
|
@ -205,9 +213,11 @@ class Database {
|
|||
// Helper function
|
||||
this.sequelize.uppercaseFirst = (str) => (str ? `${str[0].toUpperCase()}${str.substr(1)}` : '')
|
||||
|
||||
const extensions = this.loadUnicodeExtionsion ? [process.env.SQLEAN_UNICODE_PATH] : []
|
||||
|
||||
try {
|
||||
await this.sequelize.authenticate()
|
||||
await this.loadExtensions([process.env.SQLEAN_UNICODE_PATH])
|
||||
await this.loadExtensions(extensions)
|
||||
Logger.info(`[Database] Db connection was successful`)
|
||||
return true
|
||||
} catch (error) {
|
||||
|
|
@ -826,15 +836,6 @@ class Database {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} value
|
||||
* @returns {string}
|
||||
*/
|
||||
normalize(value) {
|
||||
return `lower(unaccent(${value}))`
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} query
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue