mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 22:59:37 +02:00
Remove ffmpeg binaries install step from debian preinst script
This commit is contained in:
parent
2c453a34ee
commit
3ac604c665
2 changed files with 20 additions and 24 deletions
|
@ -216,6 +216,10 @@ class Database {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string[]} extensions paths to extension binaries
|
||||
*/
|
||||
async loadExtensions(extensions) {
|
||||
// This is a hack to get the db connection for loading extensions.
|
||||
// The proper way would be to use the 'afterConnect' hook, but that hook is never called for sqlite due to a bug in sequelize.
|
||||
|
@ -827,10 +831,20 @@ class Database {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} value
|
||||
* @returns {string}
|
||||
*/
|
||||
normalize(value) {
|
||||
return `lower(unaccent(${value}))`
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} query
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async getNormalizedQuery(query) {
|
||||
const escapedQuery = this.sequelize.escape(query)
|
||||
const normalizedQuery = this.normalize(escapedQuery)
|
||||
|
@ -838,6 +852,12 @@ class Database {
|
|||
return normalizedQueryResult[0][0].normalized_query
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} column
|
||||
* @param {string} normalizedQuery
|
||||
* @returns {string}
|
||||
*/
|
||||
matchExpression(column, normalizedQuery) {
|
||||
const normalizedPattern = this.sequelize.escape(`%${normalizedQuery}%`)
|
||||
const normalizedColumn = this.normalize(column)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue