mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 14:21:41 +00:00
Added functionality to rename book folders.
This commit is contained in:
parent
f9e6655359
commit
8ccaec3d9f
12 changed files with 652 additions and 148 deletions
|
|
@ -158,7 +158,13 @@ class BookMetadata {
|
|||
if (!this.authorName) return this.title
|
||||
return this.title + '&' + this.authorName
|
||||
}
|
||||
|
||||
get genresDisplay() {
|
||||
if (!this.genres.length) return ''
|
||||
return this.genres.join(', ')
|
||||
}
|
||||
get explicitDisplay() {
|
||||
return this.explicit ? 'Explicit' : 'Not Explicit'
|
||||
}
|
||||
hasAuthor(id) {
|
||||
return !!this.authors.find(au => au.id == id)
|
||||
}
|
||||
|
|
@ -184,7 +190,24 @@ class BookMetadata {
|
|||
if (!series.sequence) return series.name
|
||||
return `${series.name} #${series.sequence}`
|
||||
}
|
||||
|
||||
getSeriesNameDisplay(index) {
|
||||
if (this.validateSeries(index)) {
|
||||
return this.series[index].name
|
||||
} else { return null }
|
||||
}
|
||||
getSeriesSequenceDisplay(index) {
|
||||
if (this.validateSeries(index)) {
|
||||
return this.series[index].sequence
|
||||
} else { return null }
|
||||
}
|
||||
validateSeries(index) {
|
||||
if (this.series.length && index < this.series.length && index >= 0) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
update(payload) {
|
||||
var json = this.toJSON()
|
||||
var hasUpdates = false
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class ServerSettings {
|
|||
// Metadata - choose to store inside users library item folder
|
||||
this.storeCoverWithItem = false
|
||||
this.storeMetadataWithItem = false
|
||||
this.defaultRenameString = "$bookAuthor/$bookTitle"
|
||||
|
||||
// Security/Rate limits
|
||||
this.rateLimitLoginRequests = 10
|
||||
|
|
@ -76,6 +77,7 @@ class ServerSettings {
|
|||
|
||||
this.storeCoverWithItem = !!settings.storeCoverWithItem
|
||||
this.storeMetadataWithItem = !!settings.storeMetadataWithItem
|
||||
this.defaultRenameString = settings.defaultRenameString || "$bookAuthor/$bookTitle"
|
||||
|
||||
this.rateLimitLoginRequests = !isNaN(settings.rateLimitLoginRequests) ? Number(settings.rateLimitLoginRequests) : 10
|
||||
this.rateLimitLoginWindow = !isNaN(settings.rateLimitLoginWindow) ? Number(settings.rateLimitLoginWindow) : 10 * 60 * 1000 // 10 Minutes
|
||||
|
|
@ -131,6 +133,7 @@ class ServerSettings {
|
|||
scannerUseTone: this.scannerUseTone,
|
||||
storeCoverWithItem: this.storeCoverWithItem,
|
||||
storeMetadataWithItem: this.storeMetadataWithItem,
|
||||
defaultRenameString: this.defaultRenameString,
|
||||
rateLimitLoginRequests: this.rateLimitLoginRequests,
|
||||
rateLimitLoginWindow: this.rateLimitLoginWindow,
|
||||
backupSchedule: this.backupSchedule,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue