mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-28 23:04:59 +02:00
Improve page load queries on title, titleIgnorePrefix, and addedAt sort order
This commit is contained in:
parent
52bb28669a
commit
a13143245b
6 changed files with 363 additions and 9 deletions
|
@ -73,6 +73,10 @@ class LibraryItem extends Model {
|
|||
|
||||
/** @type {Book.BookExpanded|Podcast.PodcastExpanded} - only set when expanded */
|
||||
this.media
|
||||
/** @type {string} */
|
||||
this.title // Only used for sorting
|
||||
/** @type {string} */
|
||||
this.titleIgnorePrefix // Only used for sorting
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -677,7 +681,9 @@ class LibraryItem extends Model {
|
|||
lastScan: DataTypes.DATE,
|
||||
lastScanVersion: DataTypes.STRING,
|
||||
libraryFiles: DataTypes.JSON,
|
||||
extraData: DataTypes.JSON
|
||||
extraData: DataTypes.JSON,
|
||||
title: DataTypes.STRING,
|
||||
titleIgnorePrefix: DataTypes.STRING
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
|
@ -695,6 +701,12 @@ class LibraryItem extends Model {
|
|||
{
|
||||
fields: ['libraryId', 'mediaType', 'size']
|
||||
},
|
||||
{
|
||||
fields: ['libraryId', 'mediaType', { name: 'title', collate: 'NOCASE' }]
|
||||
},
|
||||
{
|
||||
fields: ['libraryId', 'mediaType', { name: 'titleIgnorePrefix', collate: 'NOCASE' }]
|
||||
},
|
||||
{
|
||||
fields: ['libraryId', 'mediaId', 'mediaType']
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue