mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-18 10:59:41 +02:00
Update db migration for duration, size, lastFirst, and ignore prefix columns
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const Logger = require('../../Logger')
|
||||
const uuidv4 = require("uuid").v4
|
||||
const { checkNamesAreEqual } = require('../../utils/parsers/parseNameString')
|
||||
const { checkNamesAreEqual, nameToLastFirst } = require('../../utils/parsers/parseNameString')
|
||||
|
||||
class Author {
|
||||
constructor(author) {
|
||||
@@ -29,6 +29,11 @@ class Author {
|
||||
this.libraryId = author.libraryId
|
||||
}
|
||||
|
||||
get lastFirst() {
|
||||
if (!this.name) return ''
|
||||
return nameToLastFirst(this.name)
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
|
@@ -1,4 +1,5 @@
|
||||
const uuidv4 = require("uuid").v4
|
||||
const { getTitleIgnorePrefix } = require('../../utils/index')
|
||||
|
||||
class Series {
|
||||
constructor(series) {
|
||||
@@ -23,6 +24,11 @@ class Series {
|
||||
this.libraryId = series.libraryId
|
||||
}
|
||||
|
||||
get nameIgnorePrefix() {
|
||||
if (!this.name) return ''
|
||||
return getTitleIgnorePrefix(this.name)
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
|
@@ -72,6 +72,10 @@ class MediaProgress {
|
||||
return !this.isFinished && (this.progress > 0 || (this.ebookLocation != null && this.ebookProgress > 0))
|
||||
}
|
||||
|
||||
get notStarted() {
|
||||
return !this.isFinished && this.progress == 0
|
||||
}
|
||||
|
||||
setData(libraryItem, progress, episodeId, userId) {
|
||||
this.id = uuidv4()
|
||||
this.userId = userId
|
||||
|
Reference in New Issue
Block a user