mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-17 00:08:55 +01:00
Revert unicode sqlite extension to fix db corruption #3241
This commit is contained in:
parent
c5ba40a178
commit
3a1e9abd68
@ -207,7 +207,6 @@ class Database {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.sequelize.authenticate()
|
await this.sequelize.authenticate()
|
||||||
await this.loadExtensions([process.env.SQLEAN_UNICODE_PATH])
|
|
||||||
Logger.info(`[Database] Db connection was successful`)
|
Logger.info(`[Database] Db connection was successful`)
|
||||||
return true
|
return true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -217,7 +216,7 @@ class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* TODO: Temporarily disabled
|
||||||
* @param {string[]} extensions paths to extension binaries
|
* @param {string[]} extensions paths to extension binaries
|
||||||
*/
|
*/
|
||||||
async loadExtensions(extensions) {
|
async loadExtensions(extensions) {
|
||||||
@ -827,7 +826,7 @@ class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* TODO: Temporarily unused
|
||||||
* @param {string} value
|
* @param {string} value
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
@ -836,7 +835,7 @@ class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* TODO: Temporarily unused
|
||||||
* @param {string} query
|
* @param {string} query
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
@ -855,7 +854,7 @@ class Database {
|
|||||||
*/
|
*/
|
||||||
matchExpression(column, normalizedQuery) {
|
matchExpression(column, normalizedQuery) {
|
||||||
const normalizedPattern = this.sequelize.escape(`%${normalizedQuery}%`)
|
const normalizedPattern = this.sequelize.escape(`%${normalizedQuery}%`)
|
||||||
const normalizedColumn = this.normalize(column)
|
const normalizedColumn = column
|
||||||
return `${normalizedColumn} LIKE ${normalizedPattern}`
|
return `${normalizedColumn} LIKE ${normalizedPattern}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,8 +263,9 @@ module.exports.sqlean = sqlean // for testing
|
|||||||
class BinaryManager {
|
class BinaryManager {
|
||||||
defaultRequiredBinaries = [
|
defaultRequiredBinaries = [
|
||||||
new Binary('ffmpeg', 'executable', 'FFMPEG_PATH', ['5.1'], ffbinaries), // ffmpeg executable
|
new Binary('ffmpeg', 'executable', 'FFMPEG_PATH', ['5.1'], ffbinaries), // ffmpeg executable
|
||||||
new Binary('ffprobe', 'executable', 'FFPROBE_PATH', ['5.1'], ffbinaries), // ffprobe executable
|
new Binary('ffprobe', 'executable', 'FFPROBE_PATH', ['5.1'], ffbinaries) // ffprobe executable
|
||||||
new Binary('unicode', 'library', 'SQLEAN_UNICODE_PATH', ['0.24.2'], sqlean) // sqlean unicode extension
|
// TODO: Temporarily disabled due to db corruption issues
|
||||||
|
// new Binary('unicode', 'library', 'SQLEAN_UNICODE_PATH', ['0.24.2'], sqlean) // sqlean unicode extension
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor(requiredBinaries = this.defaultRequiredBinaries) {
|
constructor(requiredBinaries = this.defaultRequiredBinaries) {
|
||||||
|
@ -975,7 +975,7 @@ module.exports = {
|
|||||||
async search(oldUser, oldLibrary, query, limit, offset) {
|
async search(oldUser, oldLibrary, query, limit, offset) {
|
||||||
const userPermissionBookWhere = this.getUserPermissionBookWhereQuery(oldUser)
|
const userPermissionBookWhere = this.getUserPermissionBookWhereQuery(oldUser)
|
||||||
|
|
||||||
const normalizedQuery = await Database.getNormalizedQuery(query)
|
const normalizedQuery = query
|
||||||
|
|
||||||
const matchTitle = Database.matchExpression('title', normalizedQuery)
|
const matchTitle = Database.matchExpression('title', normalizedQuery)
|
||||||
const matchSubtitle = Database.matchExpression('subtitle', normalizedQuery)
|
const matchSubtitle = Database.matchExpression('subtitle', normalizedQuery)
|
||||||
|
@ -314,7 +314,7 @@ module.exports = {
|
|||||||
async search(oldUser, oldLibrary, query, limit, offset) {
|
async search(oldUser, oldLibrary, query, limit, offset) {
|
||||||
const userPermissionPodcastWhere = this.getUserPermissionPodcastWhereQuery(oldUser)
|
const userPermissionPodcastWhere = this.getUserPermissionPodcastWhereQuery(oldUser)
|
||||||
|
|
||||||
const normalizedQuery = await Database.getNormalizedQuery(query)
|
const normalizedQuery = query
|
||||||
const matchTitle = Database.matchExpression('title', normalizedQuery)
|
const matchTitle = Database.matchExpression('title', normalizedQuery)
|
||||||
const matchAuthor = Database.matchExpression('author', normalizedQuery)
|
const matchAuthor = Database.matchExpression('author', normalizedQuery)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user