mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-18 21:19:44 +00:00
feat: implement duplicate title normalized filter
This commit is contained in:
parent
aa85106681
commit
ead215e777
13 changed files with 276 additions and 1 deletions
|
|
@ -78,6 +78,8 @@ class LibraryItem extends Model {
|
|||
/** @type {string} */
|
||||
this.titleIgnorePrefix // Only used for sorting
|
||||
/** @type {string} */
|
||||
this.titleNormalized // Only used for sorting
|
||||
/** @type {string} */
|
||||
this.authorNamesFirstLast // Only used for sorting
|
||||
/** @type {string} */
|
||||
this.authorNamesLastFirst // Only used for sorting
|
||||
|
|
@ -687,6 +689,7 @@ class LibraryItem extends Model {
|
|||
extraData: DataTypes.JSON,
|
||||
title: DataTypes.STRING,
|
||||
titleIgnorePrefix: DataTypes.STRING,
|
||||
titleNormalized: DataTypes.STRING,
|
||||
authorNamesFirstLast: DataTypes.STRING,
|
||||
authorNamesLastFirst: DataTypes.STRING,
|
||||
isNotConsolidated: {
|
||||
|
|
@ -719,6 +722,9 @@ class LibraryItem extends Model {
|
|||
{
|
||||
fields: ['libraryId', 'mediaType', { name: 'titleIgnorePrefix', collate: 'NOCASE' }]
|
||||
},
|
||||
{
|
||||
fields: ['libraryId', 'mediaType', { name: 'titleNormalized', collate: 'NOCASE' }]
|
||||
},
|
||||
{
|
||||
fields: ['libraryId', 'mediaType', { name: 'authorNamesFirstLast', collate: 'NOCASE' }]
|
||||
},
|
||||
|
|
@ -795,6 +801,7 @@ class LibraryItem extends Model {
|
|||
if (instance.media) {
|
||||
instance.title = instance.media.title
|
||||
instance.titleIgnorePrefix = instance.media.titleIgnorePrefix
|
||||
instance.titleNormalized = instance.media.titleNormalized
|
||||
if (instance.isBook) {
|
||||
if (instance.media.authors !== undefined) {
|
||||
instance.authorNamesFirstLast = instance.media.authorName
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue