Added functionality to rename book folders.

This commit is contained in:
yuuzhan 2023-02-20 10:34:40 -05:00
parent f9e6655359
commit 8ccaec3d9f
12 changed files with 652 additions and 148 deletions

View file

@ -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

View file

@ -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,